HBASE-27857 Fix timeout exception handling in HBaseClassTestRule. (#5231)

HBaseClassTestRule applies a timeout and a system exit rule to tests.
The timeout rule throws an exception if it hits the timeout threshold.
Since the timeout rule is applied after the system exit rule, the
system exit rule does not see the exception and does not re-enable
the system exit behavior which can cause maven to hang on some
tests.

This change applies the timeout rule before the system exit rule so
that normal system exit can be restored before the surefire forked
node is shutdown.

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
Jonathan Albrecht 2023-05-12 20:54:50 -04:00 committed by GitHub
parent e343584b50
commit 220eacf7c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -162,7 +162,7 @@ public final class HBaseClassTestRule implements TestRule {
@Override @Override
public Statement apply(Statement base, Description description) { public Statement apply(Statement base, Description description) {
return timeout.apply(systemExitRule.apply(base, description), description); return systemExitRule.apply(timeout.apply(base, description), description);
} }
} }