Skip to content

Python 3.10: cyclic-finalizer replay-clock test fails intermittently on main since #341 #343

Closed

Description

@rmcdaniel

Problem. On Python 3.10, tests/test_business_replay_clock.py::test_discard_keeps_generator_context_tokens_and_cannot_borrow_parent_time[cyclic-finalizer] fails intermittently in the full unit suite. Inside the discarded generator's finally block, the parent's clock reads 2026-11-01T00:00:03.123456+00:00 where None is expected. The finalizer that gc.collect() runs is able to read the parent workflow's replay time:

assert [('suspended', None, '2026-11-01T00:00:03.123456+00:00'), 'parent'] == [('suspended', None, None), 'parent']

Where it happened. The first failure on main was CI 44334083082 (a9d5c76, the #341 merge). It failed again in the 2.19.0 post-publish registry qualification run 44346536832 at d1c9ecdb, on both attempts, which makes that run's Target branch qualification fail. The activity-retry-cap registry cell passed. The same tree passed every cell in the candidate run 44344537143 at 4e84b0d6, and main CI 44337530564 passed at 88e3075. In a local loop on Python 3.10 (25 runs of the heartbeat and replay-clock files), d1c9ecdb and c513ceeb (2.18.0) both passed every run, so the failure depends on the full suite's GC state or ordering.

Acceptance

  • Find whether this is a real way for a discarded generator to read its parent's replay time, or only GC timing in the test, and fix the owning side. If it is a product defect, add a replay fixture.
  • After the fix, the Python 3.10 unit cell passes repeatedly on main. Then repeat the 2.19.0 registry qualification (ci.yml on main, activity_retry_cap=true, retry_cap_artifact_source=registry) to green before selecting Python SDK 2.19.0 as docs stable.

🤖 Generated with Claude Code

Activity

  1. added 2 commits that reference this issue on Nov 18, 2026
  2. rmcdaniel commented on Nov 18, 2026

    @rmcdaniel
    MemberAuthor

    Fixed and delivered. #344 (59dda1f0) makes replay_now() raise ReplayClockUnavailable for clock reads made while a garbage collection runs. Recorded history is unchanged. It shipped in 2.19.1:

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions