Skip to content

Flaky TestWaitUntilSearchAttributesOptimizationWorkflowTemporal: expected 2, actual 3 #654

Closed as not planned

Description

@longquanzheng

Observed

TestWaitUntilSearchAttributesOptimizationWorkflowTemporal failed once in Server CI and passed on rerun without code changes.

wait_until_search_attributes_optimization_test.go:117:
    Error Trace: server/integ/wait_until_search_attributes_optimization_test.go:117
                 server/integ/wait_until_search_attributes_optimization_test.go:46
    Error:       Not equal:
                 expected: 2
                 actual  : 3
    Test:        TestWaitUntilSearchAttributesOptimizationWorkflowTemporal

Shortly before the failure, the worker log shows Cached state staled, new task has unexpected events ... CachedPreviousStartedEventID 25 for the same workflow, followed by Steps S1-3, S1-4 and S1-5. WaitForFlow took 10.3s.

Where to look

  • server/integ/wait_until_search_attributes_optimization_test.go: lines 46 and 117, and what the asserted count measures.
  • The Temporal interpreter path that decides whether the optimization applies (search-attribute loading for WaitFor). Hypothesis, not verified: the count depends on workflow task timing. A sticky-cache eviction or a late signal can add one more WaitFor/Execute round, so the assertion is timing-sensitive rather than a product bug.

Evidence

The full job log is available from the run above (gh run view 38658689758 --log --job 116174497364). Download it before log retention expires.

Acceptance criteria

  • Root cause identified: either a product bug in the optimization, or a test assumption that depends on task timing.
  • Fix the product code or make the assertion deterministic (for example, assert the invariant the optimization guarantees rather than an exact count that depends on timing). Do not skip the test.
  • The test passes repeatedly. For example, run it 20 times in a loop via the Temporal integ Makefile target with -run '^TestWaitUntilSearchAttributesOptimizationWorkflowTemporal$' -count=20. Include the result in the PR.

Activity

  1. added
    type:testTest coverage, flaky tests, or test infrastructure
    P2Normal priority
    size:SAbout a day or less
    codex-readySelf-contained; can be handed to a Codex worker as is
    on Oct 26, 2026
  2. longquanzheng commented on Nov 9, 2026

    @longquanzheng
    ContributorAuthor

    The Go Server integ suite, including this Temporal-only test, was removed in #1059. Closing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal prioritycodex-readySelf-contained; can be handed to a Codex worker as issize:SAbout a day or lesstype:testTest coverage, flaky tests, or test infrastructure

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions