Skip to content

Commit

Permalink
Fix flaky TestExchangeClient.testAddLocation
Browse files Browse the repository at this point in the history
Wait for the task3 to finish after closing the client
  • Loading branch information
arhimondr authored and losipiuk committed Jan 20, 2022
1 parent c0afeb5 commit f009a46
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,14 @@ public void testAddLocation()
assertTaskIsNotFinished(buffer, task3);

exchangeClient.close();
buffer.whenTaskFinished(task3).get(10, SECONDS);
assertThat(buffer.getFinishedTasks()).containsExactlyInAnyOrder(task1, task2, task3);
assertThat(buffer.getFailedTasks().asMap()).isEmpty();

assertEventually(() -> assertEquals(exchangeClient.getStatus().getPageBufferClientStatuses().get(0).getHttpRequestState(), "not scheduled", "httpRequestState"));
assertEventually(() -> assertEquals(exchangeClient.getStatus().getPageBufferClientStatuses().get(1).getHttpRequestState(), "not scheduled", "httpRequestState"));
assertEventually(() -> assertEquals(exchangeClient.getStatus().getPageBufferClientStatuses().get(2).getHttpRequestState(), "not scheduled", "httpRequestState"));

assertThat(buffer.getFinishedTasks()).containsExactlyInAnyOrder(task1, task2, task3);
assertThat(buffer.getFailedTasks().asMap()).isEmpty();

assertTrue(exchangeClient.isFinished());
}

Expand Down

0 comments on commit f009a46

Please sign in to comment.