Skip to content

Make classic remoting handoff recovery test eventual#3318

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:fix/classic-remoting-handoff-test-race
Jul 10, 2026
Merged

Make classic remoting handoff recovery test eventual#3318
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:fix/classic-remoting-handoff-test-race

Conversation

@He-Pin

@He-Pin He-Pin commented Jul 10, 2026

Copy link
Copy Markdown
Member

Motivation

The regression test added by #3205 waits for the read-only handle disassociation and then sends one verification payload through the original association. Those events are processed by different actors, so the original EndpointReader may still be in its not-reading state and discard that payload before it processes ResumeReading.

This race surfaced in CI while validating #3300, but it is independent of that PR changes.

Modification

Wrap the final verification write and expectation in awaitAssert, with a bounded 500 ms wait per attempt. The existing default overall assertion timeout remains unchanged.

Result

The test tolerates the expected asynchronous handoff completion while still failing if the original reader never resumes and delivers a verification message.

Tests

  • JDK 17, Scala 3.8.4 focused RemotingSpec handoff test: passed (1 test)
  • JDK 17, Scala 3.8.4 full RemotingSpec: passed (22 tests)
  • JDK 17, Scala 2.13.18 focused RemotingSpec handoff test: passed (1 test)
  • sbt headerCreateAll +headerCheckAll: passed
  • scalafmt --list --mode diff-ref=origin/main: passed
  • git diff --check: passed

References

Refs #3205

Motivation:
The passive read handoff spec observes handle disassociation before the original reader has necessarily processed ResumeReading, making its single verification message timing-dependent.

Modification:
Retry the verification message with awaitAssert and a bounded per-attempt timeout until the outbound reader resumes.

Result:
The regression test still fails when reader recovery never happens while tolerating the expected cross-actor handoff delay.

Tests:
- JDK 17, Scala 3.8.4 focused RemotingSpec test: passed
- JDK 17, Scala 3.8.4 full RemotingSpec: 22 passed
- JDK 17, Scala 2.13.18 focused RemotingSpec test: passed
- sbt headerCreateAll +headerCheckAll: passed
- scalafmt --list --mode diff-ref=origin/main: passed
- git diff --check: passed

References:
Refs apache#3205
@He-Pin He-Pin added the flaky Related to flaky tests label Jul 10, 2026
@He-Pin He-Pin added this to the 2.0.0-M4 milestone Jul 10, 2026
@He-Pin He-Pin requested a review from pjfanning July 10, 2026 21:00

@pjfanning pjfanning left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@He-Pin He-Pin merged commit bc4903d into apache:main Jul 10, 2026
10 checks passed
@He-Pin He-Pin deleted the fix/classic-remoting-handoff-test-race branch July 10, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flaky Related to flaky tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants