Skip to content

fix: wait for exporter to go offline - #968

Merged
mangelajo merged 1 commit into
jumpstarter-dev:mainfrom
bennyz:worktree-fix-e2e-flake
Aug 4, 2026
Merged

fix: wait for exporter to go offline#968
mangelajo merged 1 commit into
jumpstarter-dev:mainfrom
bennyz:worktree-fix-e2e-flake

Conversation

@bennyz

@bennyz bennyz commented Aug 4, 2026

Copy link
Copy Markdown
Member

Instead of sleeping, use WaitForExporterOffline

Instead of sleeping, use WaitForExporterOffline

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The end-to-end test cleanup now waits for controller processing and exporter offline confirmation after stopping exporters.

Changes

Exporter cleanup synchronization

Layer / File(s) Summary
Wait for exporter offline state
e2e/test/exit_on_lease_end_test.go
Cleanup replaces the fixed one-second delay with a wait for controller processing and exporter offline status.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Poem

A rabbit stopped the clock’s old beat,
And watched the exporter leave its seat.
The controller checked, the state turned clear,
No hurried second disappears.
Hop, hop—cleanup now knows when it’s done!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes replacing a fixed delay with a wait for the exporter to go offline.
Description check ✅ Passed The description directly explains the change from sleeping to using WaitForExporterOffline.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/test/exit_on_lease_end_test.go`:
- Around line 71-74: Update WaitForExporterOffline in utils.go so kubectl
command errors are retried rather than treated as success, and only return
successfully when the exporter status explicitly reports the intended offline
condition, such as Online=False. Preserve the existing cleanup synchronization
used by tracker.StopAll.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 29e8525c-7eb4-497b-a520-834dab90e1a7

📥 Commits

Reviewing files that changed from the base of the PR and between 767560a and 2b6cbaa.

📒 Files selected for processing (1)
  • e2e/test/exit_on_lease_end_test.go

Comment on lines +71 to +74
// Stop any running exporter and wait for the controller to fully
// process the disconnection before the next test starts a new one.
tracker.StopAll()
time.Sleep(time.Second)
WaitForExporterOffline("test-exporter-exit-on-lease-end")

@coderabbitai coderabbitai Bot Aug 4, 2026

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Require a successful offline-status read before starting the next test.

Line 74 calls WaitForExporterOffline, but that helper ignores Kubectl errors and treats empty output as offline. A transient kubectl get failure can therefore let AfterEach continue before the controller processes the stopped exporter. This defeats the cleanup synchronization and can cause cross-test interference.

Update e2e/test/utils.go so command errors retry and the predicate requires the intended offline condition, such as Online=False.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/test/exit_on_lease_end_test.go` around lines 71 - 74, Update
WaitForExporterOffline in utils.go so kubectl command errors are retried rather
than treated as success, and only return successfully when the exporter status
explicitly reports the intended offline condition, such as Online=False.
Preserve the existing cleanup synchronization used by tracker.StopAll.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

makes sense :)

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.

@mangelajo, agreed. The finding remains open until WaitForExporterOffline retries command errors and requires an explicit offline status.

🐇

You are interacting with an AI system.

@bennyz
bennyz requested a review from mangelajo August 4, 2026 12:13
@mangelajo
mangelajo added this pull request to the merge queue Aug 4, 2026
Merged via the queue into jumpstarter-dev:main with commit 11514e1 Aug 4, 2026
23 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.

2 participants