Skip to content

🐛 fix(cmd/hive): tear down sidecar event stream and hosted runtime in supervision boot test - #14508

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-14477
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-14477

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

TestBootAgentsWith_SidecarStartsSupervision never cleared the sidecar client's event observer, so client.Runtime.streamEvents kept reconnecting every second to the closed httptest server. The test now captures the hosted runtime and calls SetEventObserver(nil) in t.Cleanup (LIFO, so it runs before the server closes), which cancels and joins the stream goroutine.

Closes #14477
Closes #14479

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

… supervision boot test

The test never unsubscribed the sidecar client's event observer, so streamEvents kept reconnecting to the closed httptest server. Clear the observer in t.Cleanup, which runs before the server closes.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 27, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but carries no changelog entry
(no changelog.d/ fragment and no CHANGELOG.md edit).

If it is user-visible — a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking —
please add a fragment file changelog.d/<category>-<pr-or-slug>.md
containing exactly your entry (see changelog.d/README.md; the
category is one of added/changed/deprecated/fixed/security). Please
do not append to CHANGELOG.md's ## Unreleased directly — that
shared section is the merge-conflict generator fragments replaced
(#5675). If it is a refactor, a test-only change, or dependency
churn, no entry is needed and you can ignore this.

This is a reminder, not a gate; it never blocks a merge.

@kubestellar-prow kubestellar-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed — no findings from this perspective.

— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed — no findings from this perspective.

— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read the tree, not just the diff. This looks correct to me.

  • src/cmd/hive/agent_runtime.go:36-44 — in sidecar mode newHostedRuntime returns *sidecarHost wrapping *client.Runtime, so both type assertions in the new cleanup succeed on this path.
  • src/crux/api/client/client.go:343-364 — syncStream cancels and blocks on <-done when the last observer clears; nothing in cmd/hive (non-test) calls SetKickObserver, so SetEventObserver(nil) is the last observer and the streamEvents goroutine (which otherwise retries every eventsRetry = 1s against the closed server) is joined before returning.
  • Ordering: the cleanup is registered inside newRuntime, i.e. after liveServe's t.Cleanup at agent_runtime_supervise_test.go:58, so LIFO runs it first — matches the comment in the diff.
  • If boot never called install() (no observer registered), syncStream is a no-op, so the cleanup is safe either way.

No test-ratchet concern: no time.Sleep added.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 9da409e into v5 Oct 27, 2026
82 of 85 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-14477 branch October 27, 2026 02:51
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#14508c6ec6e9` sha256:31118c234969403ded73470df60f95b38a7371f3450050c4a788a622fe92cfaf — download from the dashboard or `hivectl review evidence #14508`.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/S Denotes a PR that changes 10-29 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

0 participants