Skip to content

partition_balancer_test: deflake rack awareness#29704

Merged
joe-redpanda merged 1 commit intoredpanda-data:devfrom
joe-redpanda:rack_awareness_fix
Mar 5, 2026
Merged

partition_balancer_test: deflake rack awareness#29704
joe-redpanda merged 1 commit intoredpanda-data:devfrom
joe-redpanda:rack_awareness_fix

Conversation

@joe-redpanda
Copy link
Copy Markdown
Contributor

@joe-redpanda joe-redpanda commented Feb 25, 2026

test_rack_awareness runs rpk commands with a cluster that has stopped nodes.

RPK picks its own endpoint for commands, and therefore can pick the stopped node.

Though the test specifies retry for 120s with 1s backoff, the rpk command will execute against the stopped node for 30s before failing. Given this, the test retries 4 times worst case scenario. This means the test may pick the stopped node 4 times in a row approximately (1/6)^4 of test runs.

This pr changes the timeout to be 5 instead of 30s, s.t. RPK will have a substantial number of retries in which it can pick a non-dead node.

This should take us from (1/6)^4 aka ~.1% failure rate to (1/6)^24 (order of 1e-17 %) on this particular issue, at which point we are more likely for the test to fail for unrelated and genuinely anomalous reasons.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v25.3.x
  • v25.2.x
  • v25.1.x

Release Notes

  • none

test rack awareness runs rpk commands with a cluster that has stopped
nodes.
RPK picks its own endpoint for commands, and therefore can pick the
stopped node.
though the test specifies retry for 120s with 1s backoff, the rpk
command will execute against the stopped node for 30s before failing.

Changes the timeout to be 5 instead of 30s, s.t. rpk will have a
substantial number of retries in which it can pick a non-dead node.

This should take us from (1/6)^4 aka ~.1% failure rate to (1/6)^24
(vanishingly small) on this particular issue.
Copilot AI review requested due to automatic review settings February 25, 2026 16:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a test flakiness issue in the test_rack_awareness test by reducing the timeout for RPK commands from 30 seconds to 5 seconds when interacting with clusters that have stopped nodes.

Changes:

  • Adds a timeout=5 parameter to the rpk.describe_topic() call in the topic_partitions_replicas method to reduce the default 30s timeout

@joe-redpanda
Copy link
Copy Markdown
Contributor Author

I could also fix this by just hitting the admin api with an admin client configured against the surviving, not stopped nodes.

@joe-redpanda joe-redpanda merged commit 84928e1 into redpanda-data:dev Mar 5, 2026
25 of 26 checks passed
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.

3 participants