Skip to content

chore: skip nondeterministic goroutine run result test#1564

Merged
xushiwei merged 2 commits intomainfrom
xgopilot/issue-1563-1768443228
Jan 15, 2026
Merged

chore: skip nondeterministic goroutine run result test#1564
xushiwei merged 2 commits intomainfrom
xgopilot/issue-1563-1768443228

Conversation

@xgopilot
Copy link
Contributor

@xgopilot xgopilot bot commented Jan 15, 2026

Requested by @luoliwoshang

This PR skips the run result test for cl/_testgo/goroutine by setting expect.txt to ;.

Summary

  • The goroutine test output is nondeterministic by design since multiple goroutines run concurrently without enforced execution order
  • The Go scheduler does not guarantee the order of goroutine execution or printed output
  • Setting expect.txt to ; skips the run comparison while still allowing the IR generation test (out.ll) to run

Test plan

  • Verified go test -run TestRunFromTestgo/goroutine -v ./cl/ passes

Closes #1563

Generated with codeagent
Co-authored-by: luoliwoshang [email protected]

The goroutine test output is nondeterministic by design since multiple
goroutines run concurrently without enforced execution order. The Go
scheduler does not guarantee the order of goroutine execution or printed
output. Setting expect.txt to ";" skips the run comparison while still
allowing the IR generation test to run.

Closes #1563

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <[email protected]>
Copy link
Member

@luoliwoshang luoliwoshang left a comment

Choose a reason for hiding this comment

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

LGTM

xgopilot bot pushed a commit that referenced this pull request Jan 15, 2026
Merge from PR #1564 - goroutine test output is nondeterministic by design
since multiple goroutines run concurrently without enforced execution order.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <[email protected]>
@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.01%. Comparing base (475fe56) to head (bd3343c).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1564   +/-   ##
=======================================
  Coverage   91.01%   91.01%           
=======================================
  Files          45       45           
  Lines       11971    11971           
=======================================
  Hits        10896    10896           
  Misses        899      899           
  Partials      176      176           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@luoliwoshang
Copy link
Member

@xgopilot and cl/_testgo/selects have same question!

@xgopilot
Copy link
Contributor Author

xgopilot bot commented Jan 15, 2026

Done ✓

Applied the same fix to cl/_testgo/selects as was done for goroutine:

Changes:

  • Set cl/_testgo/selects/expect.txt to ; to skip run result comparison

Reason: The selects test uses goroutines with channel operations and select statements. The output order is nondeterministic because:

  • Multiple goroutines run concurrently
  • The Go scheduler doesn't guarantee execution order
  • select statement case selection is non-deterministic when multiple cases are ready

The IR generation test (out.ll) still runs; only the run comparison is skipped.

The selects test output is nondeterministic due to concurrent goroutines
and select statements without enforced execution order.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <[email protected]>
@luoliwoshang luoliwoshang requested a review from xushiwei January 15, 2026 06:10
@xushiwei xushiwei merged commit f6337d4 into main Jan 15, 2026
45 checks passed
@xgopilot xgopilot bot deleted the xgopilot/issue-1563-1768443228 branch January 15, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: Ignore nondeterministic cl/_testgo/goroutine,cl/_testgo/selects run result test

3 participants