Skip to content

Commit

Permalink
Remove racy assertions from TestQueues
Browse files Browse the repository at this point in the history
These are not an important part of the test, and are inherently racy
  • Loading branch information
cberner committed Nov 2, 2016
1 parent 6d9e397 commit 7902071
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,38 +76,28 @@ private void testBasic(boolean resourceGroups)
// wait for the first "dashboard" query to start
waitForQueryState(queryRunner, firstDashboardQuery, RUNNING);

assertEquals(queryManager.getStats().getRunningQueries(), 1);

// submit second "dashboard" query
QueryId secondDashboardQuery = createQuery(queryRunner, newDashboardSession(), LONG_LASTING_QUERY);

// wait for the second "dashboard" query to be queued ("dashboard.${USER}" queue strategy only allows one "dashboard" query to be accepted for execution)
waitForQueryState(queryRunner, secondDashboardQuery, QUEUED);

assertEquals(queryManager.getStats().getRunningQueries(), 1);

// submit first non "dashboard" query
QueryId firstNonDashboardQuery = createQuery(queryRunner, newSession(), LONG_LASTING_QUERY);

// wait for the first non "dashboard" query to start
waitForQueryState(queryRunner, firstNonDashboardQuery, RUNNING);

assertEquals(queryManager.getStats().getRunningQueries(), 2);

// submit second non "dashboard" query
QueryId secondNonDashboardQuery = createQuery(queryRunner, newSession(), LONG_LASTING_QUERY);

// wait for the second non "dashboard" query to start
waitForQueryState(queryRunner, secondNonDashboardQuery, RUNNING);

assertEquals(queryManager.getStats().getRunningQueries(), 3);

// cancel first "dashboard" query, second "dashboard" query and second non "dashboard" query should start running
cancelQuery(queryRunner, firstDashboardQuery);
waitForQueryState(queryRunner, firstDashboardQuery, FAILED);
waitForQueryState(queryRunner, secondDashboardQuery, RUNNING);

assertEquals(queryManager.getStats().getRunningQueries(), 3);
}
}

Expand Down

0 comments on commit 7902071

Please sign in to comment.