Skip to content

MOD-12823 Fix ActiveIoThreadsMetric test timeout #7605

Merged
meiravgri merged 3 commits intomasterfrom
meiravg_fix_active_io_test
Dec 2, 2025
Merged

MOD-12823 Fix ActiveIoThreadsMetric test timeout #7605
meiravgri merged 3 commits intomasterfrom
meiravg_fix_active_io_test

Conversation

@meiravgri
Copy link
Collaborator

@meiravgri meiravgri commented Dec 2, 2025

The test had a race between the test thread setting loop_th_ready = true and the UV loop thread reading it in rqAsyncCb().

If the UV thread won the race and saw loop_th_ready == false, it would skip callback execution and never retry, causing the test to timeout waiting for the callback to start.
Fixed by setting loop_th_ready = true before scheduling the uv callback.


Note

Stabilizes ActiveIoThreadsMetric by marking the loop ready before scheduling, using a timed wait for start/completion, and unskipping the test.

  • Tests:
    • tests/cpptests/coord_tests/test_cpp_io_runtime_ctx.cpp:
      • Set ctx->uv_runtime.loop_th_ready = true before scheduling the slow callback.
      • Schedule the slow callback after readiness is set to avoid race in rqAsyncCb.
      • Replace spin-wait with RS::WaitForCondition to detect callback start and completion (reuse success).
      • Remove GTEST_SKIP to re-enable the ActiveIoThreadsMetric test.

Written by Cursor Bugbot for commit 27f2a67. This will update automatically on new commits. Configure here.

@github-actions github-actions bot added the size:S label Dec 2, 2025
@meiravgri meiravgri changed the title fix race condition MOD-12823 Fix ActiveIoThreadsMetric test timeout Dec 2, 2025
@meiravgri meiravgri changed the title MOD-12823 Fix ActiveIoThreadsMetric test timeout MOD-12823 Fix ActiveIoThreadsMetric test timeout Dec 2, 2025
@meiravgri meiravgri requested a review from JoanFM December 2, 2025 10:44
@meiravgri meiravgri enabled auto-merge December 2, 2025 10:44
JoanFM
JoanFM previously approved these changes Dec 2, 2025
@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.71%. Comparing base (60c0484) to head (27f2a67).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7605      +/-   ##
==========================================
- Coverage   84.75%   84.71%   -0.05%     
==========================================
  Files         351      351              
  Lines       54204    54204              
  Branches    14567    14567              
==========================================
- Hits        45941    45919      -22     
- Misses       8072     8094      +22     
  Partials      191      191              
Flag Coverage Δ
flow 85.02% <ø> (-0.08%) ⬇️
unit 52.14% <ø> (+0.07%) ⬆️

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

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

@meiravgri meiravgri added this pull request to the merge queue Dec 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 2, 2025
@meiravgri meiravgri enabled auto-merge December 2, 2025 14:24
@meiravgri meiravgri added this pull request to the merge queue Dec 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 2, 2025
@meiravgri meiravgri added this pull request to the merge queue Dec 2, 2025
Merged via the queue into master with commit 81173b7 Dec 2, 2025
25 checks passed
@meiravgri meiravgri deleted the meiravg_fix_active_io_test branch December 2, 2025 21:28
@redisearch-backport-pull-request
Copy link
Contributor

Backport failed for 8.2, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 8.2
git worktree add -d .worktree/backport-7605-to-8.2 origin/8.2
cd .worktree/backport-7605-to-8.2
git switch --create backport-7605-to-8.2
git cherry-pick -x 81173b7238be09ad875367708d2b1166a6d7fe4c

@redisearch-backport-pull-request
Copy link
Contributor

Backport failed for 8.4, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 8.4
git worktree add -d .worktree/backport-7605-to-8.4 origin/8.4
cd .worktree/backport-7605-to-8.4
git switch --create backport-7605-to-8.4
git cherry-pick -x 81173b7238be09ad875367708d2b1166a6d7fe4c

meiravgri added a commit that referenced this pull request Dec 3, 2025
meiravgri added a commit that referenced this pull request Dec 3, 2025
implment for coordinator level

backport 7546 + #7605 fix uv thread test MOD-12823
github-merge-queue bot pushed a commit that referenced this pull request Dec 3, 2025
* backport 7546 + #7605 fix uv thread test MOD-12823

* move idfed cpp
github-merge-queue bot pushed a commit that referenced this pull request Dec 9, 2025
* WIP:
implment for coordinator level

backport 7546 + #7605 fix uv thread test MOD-12823

* remove test WITHCURSOR

* revers

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants