Skip to content

Comments

fix(tests): using Eventually to avoid the flaky test in TestWaitBlockExecutingCommand#3373

Open
ShanukaGallage wants to merge 2 commits intoapache:unstablefrom
ShanukaGallage:fix-flaky-wait-test
Open

fix(tests): using Eventually to avoid the flaky test in TestWaitBlockExecutingCommand#3373
ShanukaGallage wants to merge 2 commits intoapache:unstablefrom
ShanukaGallage:fix-flaky-wait-test

Conversation

@ShanukaGallage
Copy link

@ShanukaGallage ShanukaGallage commented Feb 18, 2026

Description

This PR fixes the flaky test TestWaitBlockExecutingCommand in wait_test.go (Fixes #3157).

The Issue:
The test previously used time.Sleep(1 * time.Second) to wait for the server to block the client. This caused flakes on slower/faster machines where the sleep duration was insufficient or excessive.

The Fix:
Replaced time.Sleep with require.Eventually. The test now explicitly checks the server's clients info for blocked_clients:1 before proceeding. This makes the test deterministic and faster.

Verification:
Run go test -v ./unit/wait/ locally -> PASSED.

@ShanukaGallage ShanukaGallage changed the title Fix flaky TestWaitBlockExecutingCommand using Eventually Fix flaky TestWaitBlockExecutingCommand by using Eventually Feb 18, 2026
@ShanukaGallage ShanukaGallage changed the title Fix flaky TestWaitBlockExecutingCommand by using Eventually test: fix flaky TestWaitBlockExecutingCommand using Eventually Feb 18, 2026
@git-hulk git-hulk changed the title test: fix flaky TestWaitBlockExecutingCommand using Eventually fix(tests): using Eventually to avoid the flaky test in TestWaitBlockExecutingCommand Feb 22, 2026
Copy link
Member

@PragmaTwice PragmaTwice left a comment

Choose a reason for hiding this comment

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

Hmmm why there's so many whitespace changes?

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 test in WAIT command blocked indefinitely during test

3 participants