Skip to content

tests: deflake TestCompactionHash - #22151

Open
Aijeyomah wants to merge 1 commit into
etcd-io:mainfrom
Aijeyomah:fix-21980-compaction-hash-flake
Open

tests: deflake TestCompactionHash#22151
Aijeyomah wants to merge 1 commit into
etcd-io:mainfrom
Aijeyomah:fix-21980-compaction-hash-flake

Conversation

@Aijeyomah

@Aijeyomah Aijeyomah commented Jul 21, 2026

Copy link
Copy Markdown

Fixes #21980

  • Made TestCompactionHash wait for compaction to finish before continuing, removing the timing-related flake.

Note on AI usage

I used AI to understand why TestCompactionHash was flaky. The fixes and the test were done by me.

Testing:

before:

GOTOOLCHAIN=auto go test -race -c ./tests/integration/clientv3 && stress ./clientv3.test --test.run TestCompactionHash | grep "runs so far"
Screenshot 2026-07-27 at 11 13 18

After the fix

GOTOOLCHAIN=auto go test -race -c ./tests/integration/clientv3 && stress ./clientv3.test --test.run TestCompactionHash
Screenshot 2026-07-27 at 11 15 20 Screenshot 2026-07-27 at 11 15 35

Wait for physical compaction to complete instead of relying on a fixed sleep, which may expire before scheduled compaction finishes.

Fixes etcd-io#21980

Signed-off-by: Eti Ijeoma <ijayeti@gmail.com>
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Aijeyomah
Once this PR has been reviewed and has the lgtm label, please assign serathius for approval. For more information see the Code Review Process.

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

@kubernetes-prow

Copy link
Copy Markdown

Hi @Aijeyomah. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@ahrtr

ahrtr commented Jul 23, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@serathius

Copy link
Copy Markdown
Member

Use stress command described in https://gist.github.com/liggitt/6a3a2217fa5f846b52519acfc0ffece0 to confirm deflaking deflake

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.69%. Comparing base (6006f40) to head (20d2663).
⚠️ Report is 57 commits behind head on main.

Additional details and impacted files

see 28 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #22151      +/-   ##
==========================================
- Coverage   69.73%   69.69%   -0.05%     
==========================================
  Files         449      449              
  Lines       38177    38188      +11     
==========================================
- Hits        26624    26615       -9     
- Misses      10123    10145      +22     
+ Partials     1430     1428       -2     

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6006f40...20d2663. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Aijeyomah

Copy link
Copy Markdown
Author

Use stress command described in https://gist.github.com/liggitt/6a3a2217fa5f846b52519acfc0ffece0 to confirm deflaking deflake

@serathius Thanks. I have confirmed using the stress command and updated the command and result in the pr description

@serathius

Copy link
Copy Markdown
Member

Don't see changes. Please faimilarize youself with https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#ai-guidance

Or this PR will be closed

@Aijeyomah

Copy link
Copy Markdown
Author

/retest

@Aijeyomah

Copy link
Copy Markdown
Author

Don't see changes. Please faimilarize youself with https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#ai-guidance

Or this PR will be closed

I have updated the PR description properly and added my usage of AI. I also added screenshots of the results before and after the fix using the stress test commands.

@kubernetes-prow

kubernetes-prow Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Aijeyomah: 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
pull-etcd-robustness-arm64 20d2663 link true /test pull-etcd-robustness-arm64

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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

Development

Successfully merging this pull request may close these issues.

Flaky TestCompactionHash

3 participants