fix testSecuredGetServer ut (#3262)

This commit is contained in:
Parag Jain 2016-07-20 12:20:13 -05:00 committed by Fangjin Yang
parent 06624c40c0
commit fd798d32bc

View File

@ -252,6 +252,10 @@ public class QueryResourceTest
// WRITE corresponds to cancellation of query // WRITE corresponds to cancellation of query
if (action.equals(Action.READ)) { if (action.equals(Action.READ)) {
try { try {
// Countdown startAwaitLatch as we want query cancellation to happen
// after we enter isAuthorized method so that we can handle the
// InterruptedException here because of query cancellation
startAwaitLatch.countDown();
waitForCancellationLatch.await(); waitForCancellationLatch.await();
} }
catch (InterruptedException e) { catch (InterruptedException e) {
@ -295,7 +299,6 @@ public class QueryResourceTest
public void run() public void run()
{ {
try { try {
startAwaitLatch.countDown();
Response response = queryResource.doPost( Response response = queryResource.doPost(
new ByteArrayInputStream(queryString.getBytes("UTF-8")), new ByteArrayInputStream(queryString.getBytes("UTF-8")),
null, null,