Skip to content

Wait for the port-forward instead of sleeping in the smoke test - #861

Merged
janhoy merged 2 commits into
apache:mainfrom
janhoy:fix-smoke-test-port-forward-race
Oct 25, 2026
Merged

janhoy merged 2 commits into
apache:mainfrom
janhoy:fix-smoke-test-port-forward-race

Conversation

@janhoy

@janhoy janhoy commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

The smoke test intermittently fails right after Check the admin URL to make sure it works. The run log shows why: the backgrounded kubectl port-forward logged Forwarding from 127.0.0.1:18983 540ms after the curl following the fixed sleep 2 had already been refused. Under set -e a refused connection aborts the whole smoke test.

Replaces the two sleep 2 calls that follow a port-forward with a helper that polls the port until it answers, up to 60s. The sleep 15 before the prometheus exporter query is left alone, since it waits for the exporter to scrape rather than for the forward.

Seen on run 40035568922 (PR #856); the same test passed on another branch on the same runner image, so it is a flake rather than a regression.


🤖 AI assisted

The smoke test intermittently fails on CI immediately after printing
"Check the admin URL to make sure it works":

  make: *** [Makefile:227: smoke-test] Error 1

The run log shows the cause. The backgrounded 'kubectl port-forward' logged
"Forwarding from 127.0.0.1:18983" at 23:05:40.029, which is 540ms *after* the
curl that follows the fixed 'sleep 2' had already been refused at 23:05:39.489.
With 'set -e' a refused connection aborts the whole smoke test.

Replace the two 'sleep 2' calls that follow a port-forward with a helper that
polls the port until it answers, for up to 60 seconds. The 'sleep 15' before the
prometheus exporter query is deliberately left alone: it waits for the exporter
to scrape rather than just for the forward to come up, and has a much larger
margin.

This flake is not related to pinning the actions. The same smoke test passed on
another branch on the same ubuntu-26.04 runner image, and the pinned SHAs are
the commits the floating major tags already pointed at.
@janhoy
janhoy requested a lite review from Copilot October 24, 2026 12:11
@janhoy janhoy added the bug Something isn't working label Oct 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The readiness helper must enforce the documented 60-second timeout before approval.

1 open issue
What changed in this PR

This pull request replaces fixed delays after Solr kubectl port-forward commands with readiness polling to reduce intermittent smoke-test failures.

Changes:

  • Adds a reusable helper to poll forwarded ports.
  • Replaces both Solr-related sleep 2 calls with port-readiness checks.
  • Keeps the Prometheus exporter scrape delay unchanged.
File Summary
hack/​release/​smoke_test/​test_cluster.sh Adds and applies port-forward readiness polling. The helper may wait substantially longer than the documented 60-second limit because it counts attempts rather than elapsed time; it should track a wall-clock deadline and bound probes by the remaining time.

Review effort: Lite

Comment thread hack/release/smoke_test/test_cluster.sh Outdated
Counting attempts let a hanging connection stretch the 60s limit to
180s, since each probe could burn its own --max-time plus the sleep.
@janhoy
janhoy merged commit 86f727a into apache:main Oct 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants