Skip to content

Commit

Permalink
util-app: Attempt to fix flaky test in GitHub CI
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbr committed May 18, 2023
1 parent 1904b60 commit 344ac48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion util-app/src/test/scala/com/twitter/app/AppTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class WeNeverCloseButWeDoNotCare extends WeNeverClose {
}

trait ErrorOnExitApp extends App {
override val defaultCloseGracePeriod: Duration = 10.seconds
override val defaultCloseGracePeriod: Duration = 30.seconds

override def exitOnError(throwable: Throwable): Unit = {
throw throwable
Expand Down Expand Up @@ -397,6 +397,10 @@ class AppTest extends AnyFunSuite {
}

test("App: exit functions properly capture mix of non-fatal and fatal exceptions") {
// This test case is known to be flaky on GitHub CI because it throws a `TimeoutException` before the expected
// `InterruptedException` is thrown.
// I suspect this is due to CI has limited CPU resources compared to local development while running lots of test
// suites in parallel.
val app = new ErrorOnExitApp {
def main(): Unit = {
onExit {
Expand Down

0 comments on commit 344ac48

Please sign in to comment.