Skip to content

Comments

test: fix flaky TestWaitBlockExecutingCommand using Eventually#3373

Open
ShanukaGallage wants to merge 1 commit intoapache:unstablefrom
ShanukaGallage:fix-flaky-wait-test
Open

test: fix flaky TestWaitBlockExecutingCommand using Eventually#3373
ShanukaGallage wants to merge 1 commit 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
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

1 participant