Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
keith-turner committed Sep 3, 2024
1 parent 08e40f8 commit 6669e99
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ public void testMaxLatency() throws Exception {

executor.submit(createWriterTask(client, table1, timer));
executor.submit(createWriterTask(client, table2, timer));
executor.submit(createWriterTask(client, table3, timer));

// wait for some data to be written
Wait.waitFor(() -> readMaxElapsed(client, IMMEDIATE, table1) > 0
&& readMaxElapsed(client, IMMEDIATE, table2) > 0
&& readMaxElapsed(client, IMMEDIATE, table3) > 0);

long lastMaxSeen = -1;
int changes = 0;
Expand Down Expand Up @@ -125,10 +131,6 @@ public void testMaxLatency() throws Exception {
executor.awaitTermination(600, TimeUnit.SECONDS);

assertEquals(-1, readMaxElapsed(client, EVENTUAL, table2));
// This test assumes the 2nd table returns nothing because it is reading it via scan server.
// Validate this test assumption by doing an immediate scan using tablet server which should
// return data.
assertTrue(readMaxElapsed(client, IMMEDIATE, table2) > 0);
// Now that nothing is writing its expected that max read by an immediate scan will see any
// data an eventual scan would see.
assertTrue(
Expand Down

0 comments on commit 6669e99

Please sign in to comment.