Skip to content

fix: stabilize flaky TestSyncClientImpl_InternalKeys#939

Merged
merlimat merged 2 commits intomainfrom
fix/flaky-tests-and-health-ping
Mar 9, 2026
Merged

fix: stabilize flaky TestSyncClientImpl_InternalKeys#939
merlimat merged 2 commits intomainfrom
fix/flaky-tests-and-health-ping

Conversation

@mattisonchao
Copy link
Copy Markdown
Member

@mattisonchao mattisonchao commented Mar 8, 2026

Summary

  • Fix flaky TestSyncClientImpl_InternalKeys that failed intermittently on CI
  • The test used assert.NotEmpty with assert.Eventually to check for remaining RangeScan results after consuming 4 items with ShowInternalKeys(true)
  • Root cause: system-created internal keys (__oxia/commit-offset, __oxia/term, etc.) arrive asynchronously via a buffered channel, making assert.NotEmpty timing-dependent
  • Fix: drain remaining system-internal keys deterministically with for range resCh

Closes #936

Test plan

  • 20/20 pass locally with -race -count=20

@mattisonchao mattisonchao force-pushed the fix/flaky-tests-and-health-ping branch from 663a2a0 to ff8db39 Compare March 8, 2026 18:51
The test used `assert.NotEmpty` to check for remaining items after
consuming 4 RangeScan results with ShowInternalKeys(true). This was
flaky because system-created internal keys (__oxia/commit-offset,
__oxia/term, etc.) arrive asynchronously via a buffered channel.

Replace with collecting remaining items and verifying they have the
`__oxia/` internal key prefix.

Closes #936

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: mattisonchao <mattisonchao@gmail.com>
@mattisonchao mattisonchao force-pushed the fix/flaky-tests-and-health-ping branch from 8b7641b to eda78b8 Compare March 8, 2026 19:07
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: mattisonchao <mattisonchao@gmail.com>
@mattisonchao mattisonchao self-assigned this Mar 8, 2026
@merlimat merlimat merged commit 362fff4 into main Mar 9, 2026
9 checks passed
@merlimat merlimat deleted the fix/flaky-tests-and-health-ping branch March 9, 2026 00:09
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.

Flaky tests: TestLeaderHintWithoutClient and TestLeaderBalancedNodeAdded

2 participants