Skip to content

Commit

Permalink
finagle/finagle-thriftmux: Fix flakey thriftmux.MethodBuilder test
Browse files Browse the repository at this point in the history
Problem

When testing deadline application in the timeout filter, we expect a GlobalRequestTimeout
to be thrown from the global timeout filter due to the short deadline. However, an
IndividualRequestTimeoutException can also be thrown -- the filters set very similar
timeouts due to the deadline being shorter than each of their respective timeouts, and
hence the interrupts race.

Solution

Exception a generic RequestTimeoutException instead.

JIRA Issues: CSL-12415

Differential Revision: https://phabricator.twitter.biz/D1108542
  • Loading branch information
jcrossley authored and jenkins committed Nov 5, 2023
1 parent 92c7d4d commit 1609ebb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion finagle-thriftmux/src/test/scala/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ junit_tests(
platform = "java8",
tags = [
"bazel-compatible",
"known-to-fail-jira:CSL-12415",
],
dependencies = [
"3rdparty/jvm/junit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,11 @@ class MethodBuilderTest extends AnyFunSuite with Eventually {

toggleOnCtx {
Contexts.broadcast.let(Deadline, Deadline.ofTimeout(5.millis)) {
// short deadline should fire
intercept[GlobalRequestTimeoutException] {
// short deadline should fire. Note that the RequestTimeoutException that fires could be either
// an [[IndividualRequestTimeoutException]] or a [[GlobalRequestTimeoutException]], due to racing
// interrupts, since the global and individual filters have a very similar timeout after applying
// our deadline.
intercept[RequestTimeoutException] {
await(shortTimeoutSvcPerEndpoint(TestService.Query.Args("shorty")))
}
}
Expand Down

0 comments on commit 1609ebb

Please sign in to comment.