Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix flaky util-app test in GitHub CI #310

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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