Skip to content

Deflake io-threads test by generating enough work#3354

Merged
zuiderkwast merged 2 commits into
valkey-io:unstablefrom
sarthakaggarwal97:deflake-macos-iothreads-test
Mar 11, 2026
Merged

Deflake io-threads test by generating enough work#3354
zuiderkwast merged 2 commits into
valkey-io:unstablefrom
sarthakaggarwal97:deflake-macos-iothreads-test

Conversation

@sarthakaggarwal97

@sarthakaggarwal97 sarthakaggarwal97 commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Fixes the failing run: https://github.com/valkey-io/valkey/actions/runs/22810251608/job/66165776196#step:7:8704

[err]: Force the use of IO threads and assert active IO thread usage in tests/unit/io-threads.tcl
Expected '0.000000' to be more than '0' (context: type source line 49 file /Users/runner/work/valkey/valkey/tests/unit/io-threads.tcl cmd {assert_morethan $used_active_time 0} proc ::test)

The change deflakes the test by generating enough I/O-thread work.

The test previously created 16 deferred clients but only sent 15 total INCR commands. On fast runners, that burst could be short enough that used_active_time_io_thread_* was still reported as 0.000000, causing the test to fail even though I/O threads had run.

Passing Run 200 times: https://github.com/sarthakaggarwal97/valkey/actions/runs/22869618064

@codecov

codecov Bot commented Mar 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.05%. Comparing base (a7d919a) to head (dea643d).
⚠️ Report is 4 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #3354      +/-   ##
============================================
+ Coverage     75.03%   75.05%   +0.01%     
============================================
  Files           129      129              
  Lines         71724    71724              
============================================
+ Hits          53821    53831      +10     
+ Misses        17903    17893      -10     

see 25 files with indirect coverage changes

🚀 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.

@dvkashapov dvkashapov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@zuiderkwast zuiderkwast left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@zuiderkwast zuiderkwast changed the title [flaky-tests]: deflake io-threads test by generating enough work Deflake io-threads test by generating enough work Mar 11, 2026
@zuiderkwast zuiderkwast merged commit 2a12449 into valkey-io:unstable Mar 11, 2026
58 checks passed
JimB123 pushed a commit that referenced this pull request Mar 19, 2026
Fixes the failing run:

```
[err]: Force the use of IO threads and assert active IO thread usage in tests/unit/io-threads.tcl
Expected '0.000000' to be more than '0' (context: type source line 49 file /Users/runner/work/valkey/valkey/tests/unit/io-threads.tcl cmd {assert_morethan $used_active_time 0} proc ::test)
```

The change deflakes the test by generating enough I/O-thread work.

The test previously created 16 deferred clients but only sent 15 total
`INCR` commands. On fast runners, that burst could be short enough that
`used_active_time_io_thread_*` was still reported as `0.000000`, causing
the test to fail even though I/O threads had run.

Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com>
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.

3 participants