Skip to content

test: stabilize flaky TestWorkerPool/TwoWorkers#69767

Open
flaky-claw wants to merge 1 commit into
pingcap:masterfrom
flaky-claw:flakyfixer/case_69268d7888b0-a1
Open

test: stabilize flaky TestWorkerPool/TwoWorkers#69767
flaky-claw wants to merge 1 commit into
pingcap:masterfrom
flaky-claw:flakyfixer/case_69268d7888b0-a1

Conversation

@flaky-claw

@flaky-claw flaky-claw commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #69730

Problem Summary:
Flaky test TestWorkerPool/TwoWorkers in pkg/executor intermittently fails, so this PR stabilizes that path.

What changed and how does it work?

Root Cause

TwoWorkers depended on a 1 ms sleep to let worker 2 start; overloaded scheduling could let worker 1 append 2 first.

Fix

Channel synchronization observes the intended second-worker start directly and keeps the original [1,3,2,4] assertion.

Verification

Spec:

  • target: pkg/executor :: TestWorkerPool/TwoWorkers
  • strategy: tidb.go_flaky.default
  • plan mode: BASELINE_ONLY
  • requirements: required case must execute; no skip; repeat count = 1
  • execution surface: GO_TEST_WITH_TAGS
  • build tags: intest, deadlock
  • baseline gates: required_flaky_gate, build_safety_gate, intent_guard_gate
  • feedback surface source: baseline_only

Observed result:

  • status: passed
  • required case executed: yes
  • submission decision: ALLOWED
  • note: Required flaky case executed during validation.
    Required flaky case was not skipped.
    target_exact passed.
    build passed.
    lint passed.

Gate checklist:

  • timing_repro: SKIPPED
  • target_exact: PASS
  • target_failpoint_harness: SKIPPED
  • build: PASS
  • lint: PASS

Commands:

  • go test -json -tags=intest,deadlock ./pkg/executor -run '^TestWorkerPool/TwoWorkers$' -count=1
  • make build
  • make lint

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Fixes #69730

Summary by CodeRabbit

  • Tests
    • Improved worker pool test reliability by replacing timing-based waits with explicit synchronization.
    • Added coverage to verify queued tasks are picked up by the second worker in the expected execution order.
    • Added timeout-based failure reporting when the second worker does not start as expected.

@ti-chi-bot ti-chi-bot Bot added the release-note-none Denotes a PR that doesn't merit a release note. label Jul 10, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jiyfhust for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ca07beef-c90e-40fe-b293-06d1fa728e75

📥 Commits

Reviewing files that changed from the base of the PR and between 59ca788 and 2393238.

📒 Files selected for processing (1)
  • pkg/executor/utils_test.go

📝 Walkthrough

Walkthrough

The TestWorkerPool/TwoWorkers subtest replaces timing-based waiting with channel synchronization, timeout-based failure reporting, and assertions for the synchronized execution order.

Changes

Worker pool test synchronization

Layer / File(s) Summary
Synchronize queued worker execution
pkg/executor/utils_test.go
The test coordinates second-worker startup and completion through channels, fails if startup does not occur within five seconds, and expects execution order {1, 3, 2, 4}.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: approved, lgtm

Suggested reviewers: xhebox, tiancaiamao, hawkingrei

Poem

A rabbit nudges channels wide,
“No sleepy timers!” they cried.
The workers hop in ordered cheer,
With timeout guards keeping clear.
{1, 3, 2, 4}—a tidy ride!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately describes the main change: stabilizing the flaky TestWorkerPool/TwoWorkers test.
Linked Issues check ✅ Passed The change directly addresses issue #69730 by stabilizing the flaky TestWorkerPool/TwoWorkers test in pkg/executor.
Out of Scope Changes check ✅ Passed The patch stays within scope, making only test synchronization and assertion updates related to the flaky worker pool case.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.2777%. Comparing base (59ca788) to head (2393238).

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #69767        +/-   ##
================================================
- Coverage   76.3197%   74.2777%   -2.0420%     
================================================
  Files          2041       2054        +13     
  Lines        560107     576092     +15985     
================================================
+ Hits         427472     427908       +436     
- Misses       131734     147877     +16143     
+ Partials        901        307       -594     
Flag Coverage Δ
integration 40.9188% <ø> (+1.2135%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 60.4471% <ø> (ø)
parser ∅ <ø> (∅)
br 47.4060% <ø> (-15.3154%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ti-chi-bot

ti-chi-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

@flaky-claw: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/check_dev_2 2393238 link true /test check-dev2

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: TestWorkerPool/TwoWorkers in pkg/executor

1 participant