[TEST] Ensure interrupted flag reset after test that sets it (#37230)

Test fix to stop a problem in one test leaking into a different
test and causing that other test to spuriously fail.
This commit is contained in:
David Roberts 2019-01-09 08:51:00 +00:00 committed by GitHub
parent 224475e6aa
commit f14cff2102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -72,6 +72,9 @@ public class TimeoutCheckerTests extends FileStructureTestCase {
} finally {
TimeoutChecker.watchdog.unregister();
}
} finally {
// ensure the interrupted flag is cleared to stop it making subsequent tests fail
Thread.interrupted();
}
}
@ -89,6 +92,9 @@ public class TimeoutCheckerTests extends FileStructureTestCase {
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();
}
}
}