Skip to content

Commit

Permalink
[TEST] Ensure interrupted flag reset after test that sets it (#37230)
Browse files Browse the repository at this point in the history
Test fix to stop a problem in one test leaking into a different
test and causing that other test to spuriously fail.
  • Loading branch information
droberts195 committed Jan 9, 2019
1 parent 224475e commit f14cff2
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -72,6 +72,9 @@ public void testWatchdog() {
} finally {
TimeoutChecker.watchdog.unregister();
}
} finally {
// ensure the interrupted flag is cleared to stop it making subsequent tests fail
Thread.interrupted();
}
}

Expand All @@ -89,6 +92,9 @@ public void testGrokCaptures() throws Exception {
assertEquals("Aborting grok captures test during [should timeout] as it has taken longer than the timeout of [" +
timeout + "]", e.getMessage());
});
} finally {
// ensure the interrupted flag is cleared to stop it making subsequent tests fail
Thread.interrupted();
}
}
}

0 comments on commit f14cff2

Please sign in to comment.