Skip to content

Commit b181920

Browse files
CR: delay it all
1 parent f914113 commit b181920

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

test/framework/src/main/java/org/elasticsearch/test/disruption/DisruptableMockTransport.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,9 @@ public void run() {
205205
break;
206206

207207
case BLACK_HOLE:
208-
logger.trace("blackholed during response to {}: channel is {}", requestDescription, connectionStatus);
209-
onBlackholedDuringSend(requestId, action, destinationTransport);
210-
break;
211208
case DISCONNECTED:
212-
logger.trace("disconnected during response to {}: channel is {}", requestDescription, connectionStatus);
213-
onDisconnectedDuringSend(requestId, action, destinationTransport);
209+
logger.trace("delaying response to {}: channel is {}", requestDescription, connectionStatus);
210+
onBlackholedDuringSend(requestId, action, destinationTransport);
214211
break;
215212

216213
default:
@@ -239,14 +236,10 @@ public void run() {
239236
break;
240237

241238
case BLACK_HOLE:
242-
logger.trace("blackholed during exception response to {}: channel is {}",
243-
requestDescription, connectionStatus);
244-
onBlackholedDuringSend(requestId, action, destinationTransport);
245-
break;
246239
case DISCONNECTED:
247-
logger.trace("disconnected during exception response to {}: channel is {}",
240+
logger.trace("delaying exception response to {}: channel is {}",
248241
requestDescription, connectionStatus);
249-
onDisconnectedDuringSend(requestId, action, destinationTransport);
242+
onBlackholedDuringSend(requestId, action, destinationTransport);
250243
break;
251244

252245
default:

test/framework/src/test/java/org/elasticsearch/test/disruption/DisruptableMockTransportTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public void testDisconnectedOnSuccessfulResponse() throws IOException {
327327

328328
disconnectedLinks.add(Tuple.tuple(node2, node1));
329329
responseHandlerChannel.get().sendResponse(TransportResponse.Empty.INSTANCE);
330-
deterministicTaskQueue.runAllRunnableTasks();
330+
deterministicTaskQueue.runAllTasks();
331331
assertThat(responseHandlerException.get(), instanceOf(ConnectTransportException.class));
332332
}
333333

@@ -344,7 +344,7 @@ public void testDisconnectedOnExceptionalResponse() throws IOException {
344344

345345
disconnectedLinks.add(Tuple.tuple(node2, node1));
346346
responseHandlerChannel.get().sendResponse(new Exception());
347-
deterministicTaskQueue.runAllRunnableTasks();
347+
deterministicTaskQueue.runAllTasks();
348348
assertThat(responseHandlerException.get(), instanceOf(ConnectTransportException.class));
349349
}
350350

0 commit comments

Comments
 (0)