Skip to content

[Bug]: TestTxnManager1 relies on sleeps for commit ordering #28709

Closed

Description

@ck89119

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main (observed on PR #28499)

Commit ID

d990b80

Other Environment Information

Actual Behavior

pkg/vm/engine/tae/txn/txnimpl.TestTxnManager1 intermittently fails its sequence assertion:

expected: []int{1, 2, 3, 4}
actual:   []int{1, 3, 2, 4}

This was the only reported failing UT case.

Expected Behavior

The test should deterministically synchronize the commit phases and assert the intended transaction ordering without relying on scheduler timing.

Steps to Reproduce

.agents/skills/mo-dev/scripts/mo-cgo-test -v -count=100 -timeout=120s \
  -run '^TestTxnManager1$' ./pkg/vm/engine/tae/txn/txnimpl

The failure is intermittent; this command is a stress reproduction target, not a guaranteed reproducer.

Additional information

The test uses time.Sleep(100ms) in txn1's prepare callback and time.Sleep(10ms) in a competing goroutine. These sleeps do not establish a happens-before relationship. In the failed run, the waiter returned and appended step 3 before the prepare callback appended step 2.

PR #28499 changes unary-minus planning/execution and has no diff in this package or test relative to main. A fix should use deterministic channels/barriers around the transaction state transition instead of increasing sleeps, retrying the assertion, or accepting both orders.

Activity

  1. self-assigned this
    on Sep 11, 2026
  2. added
    kind/bug
    on Sep 11, 2026
  3. added a commit that references this issue on Sep 11, 2026
    6637636
  4. added
    severity/s0
    and removed on Sep 11, 2026
  5. added 3 commits that reference this issue on Sep 17, 2026
    8ee37a1
    37c12e4
    fcbe6b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions