Skip to content

Fix flaky AsyncWrapper reset_state test on Python 3.14 - #39521

Merged
tvalentyn merged 1 commit into
apache:masterfrom
bvolpato:bvolpato/fix-async-reset-state-py314
Jul 28, 2026
Merged

Fix flaky AsyncWrapper reset_state test on Python 3.14#39521
tvalentyn merged 1 commit into
apache:masterfrom
bvolpato:bvolpato/fix-async-reset-state-py314

Conversation

@bvolpato

@bvolpato bvolpato commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #39456.

Summary

The deadlock regression test currently starts its 10-second timeout at process creation. That timeout includes child startup and imports, even though failure is reported as a reset_state() deadlock. Python 3.14 uses forkserver by default on POSIX, making this distinction more relevant.

This change adds a readiness signal immediately before reset_state(). Parent uses a separate startup timeout, then applies existing 10-second limit only to teardown. This preserves real deadlock detection and gives distinct failures for startup and teardown. Production code is unchanged.

Validation

  • Python 3.14 cloud tox target: 2 passed
  • Python 3.13 tox target: 2 passed
  • Python 3.14 cloud stress: 100/100 passes for each asyncio and thread-pool variant
  • Negative control: injected 11-second stall after readiness signal; test failed at original 10-second deadlock assertion
  • YAPF 0.43.0 and Ruff 0.15.7 passed on changed file

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@bvolpato bvolpato changed the title Fix flaky AsyncWrapper reset_state test Fix flaky AsyncWrapper reset_state test on Python 3.14 Jul 28, 2026
@bvolpato
bvolpato marked this pull request as ready for review July 28, 2026 05:20
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @jrmccluskey for label python.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@tvalentyn

Copy link
Copy Markdown
Contributor

Thanks, @bvolpato!

filed #39526 for another flake in Python 3.10

@tvalentyn
tvalentyn merged commit dd463fa into apache:master Jul 28, 2026
98 of 99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Failing Test]: _run_reset_state_concurrent_teardown is flaky

2 participants