Skip to content

test(e2e): fixed trafficTestResult interval for (systemd_)resiliency - #670

Draft
andreaskaris wants to merge 1 commit into
openperouter:mainfrom
andreaskaris:fix/issue664
Draft

test(e2e): fixed trafficTestResult interval for (systemd_)resiliency#670
andreaskaris wants to merge 1 commit into
openperouter:mainfrom
andreaskaris:fix/issue664

Conversation

@andreaskaris

@andreaskaris andreaskaris commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Is this a BUG FIX or a FEATURE ?:

/kind flake

What this PR does / why we need it:

measureTrafficLoss did not use a fixed interval for when it ran its
tests. Meaning that if a curl hung, each run would happen at ca.
2 seconds + 300 ms. Use a 500ms ticker instead and cap the curl at
400ms. Set maxAllowedFailures to 40 to allow for a maximum ~20 seconds
of downtime.
Also make sure that traffic actually works again before stopping and
counting.

Special notes for your reviewer:
Related to: #664
This PR adds a few improvements and increases the timeout by a few seconds.

However, the underlying RC for the issue seem to be repeated reconciles which in turn delay BGP session establishment and I'm not sure how to address this.

Release note:

None

AI Guidelines Acknowledgment:

  • I have reviewed all changes in this PR, including any AI-generated content, and I take full responsibility for its accuracy and correctness.

Summary by CodeRabbit

  • Bug Fixes
    • Improved resiliency test validation by confirming traffic has recovered before measuring disruption.
    • Updated traffic monitoring to provide more consistent recovery results.
    • Added clearer failure reporting, including failure timestamps and recovery details.
    • Tests now detect missing traffic measurements and allow a defined level of disruption before failing.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@andreaskaris, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 321da1db-eefb-4bc3-a819-23bd3cd566ec

📥 Commits

Reviewing files that changed from the base of the PR and between 7be517d and eaf6d1a.

📒 Files selected for processing (2)
  • e2etests/tests/resiliency.go
  • e2etests/tests/systemd_resiliency.go
📝 Walkthrough

Walkthrough

The resiliency tests now verify traffic after router recovery. Traffic polling uses shorter intervals and curl timeouts. Evaluation rejects empty measurements, permits up to 40 failures, and reports failure timestamps.

Changes

Resiliency traffic validation

Layer / File(s) Summary
Traffic measurement and evaluation
e2etests/tests/resiliency.go
Traffic polling uses a 500 ms ticker and a 400 ms curl timeout. Empty measurements now return an error. The failure limit is 40, and result strings include failure timestamps.
Post-recovery connectivity checks
e2etests/tests/resiliency.go, e2etests/tests/systemd_resiliency.go
The tests verify stretched-L2 connectivity after router deletion or restart before evaluating traffic loss. Failure messages include the complete measurement result.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ResiliencyTest
  participant RouterPod
  participant curl
  participant trafficTestResult
  ResiliencyTest->>RouterPod: Delete or restart router pod
  RouterPod-->>ResiliencyTest: Complete recovery
  ResiliencyTest->>curl: Verify stretched-L2 traffic
  ResiliencyTest->>trafficTestResult: Evaluate traffic disruption
  trafficTestResult-->>ResiliencyTest: Return result or error
Loading

Possibly related PRs

Suggested reviewers: maiqueb, qinqon, ramlavi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies an end-to-end test fix for traffic measurement in the systemd and standard resiliency tests.
Description check ✅ Passed The description includes the change type, purpose, reviewer notes, related issue, release note, and AI acknowledgment.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
e2etests/tests/resiliency.go (1)

697-700: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Match the threshold comment to the code.

The comment states that the test permits 10 failures. maxAllowedFailures permits 40 failures. Update the comment to prevent an incorrect disruption budget from being maintained later.

🤖 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 `@e2etests/tests/resiliency.go` around lines 697 - 700, Update the comment
above eval to state that the test permits up to 40 failures, and revise the
corresponding downtime calculation to match the 500ms tick interval.
🤖 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 `@e2etests/tests/resiliency.go`:
- Around line 671-685: Update the executor calls at
e2etests/tests/resiliency.go:671-685, e2etests/tests/resiliency.go:642-646, and
e2etests/tests/systemd_resiliency.go:454-458 to use the deadline-aware
Executor.Exec variant, passing the relevant collector or test context so the
enclosing kubectl exec is cancelled when the deadline or spec ends. Preserve the
existing curl arguments and result handling.

In `@e2etests/tests/systemd_resiliency.go`:
- Around line 460-466: Update the failure message in the stopAndCount result
assertion to describe routerpod-pod.service restart and recovery instead of
router pod deletion and recovery, while preserving the existing threshold and
result details.

---

Nitpick comments:
In `@e2etests/tests/resiliency.go`:
- Around line 697-700: Update the comment above eval to state that the test
permits up to 40 failures, and revise the corresponding downtime calculation to
match the 500ms tick interval.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 408a2ccc-8c91-487b-b05a-cde71eab239c

📥 Commits

Reviewing files that changed from the base of the PR and between 1538527 and 7be517d.

📒 Files selected for processing (2)
  • e2etests/tests/resiliency.go
  • e2etests/tests/systemd_resiliency.go

Comment thread e2etests/tests/resiliency.go
Comment thread e2etests/tests/systemd_resiliency.go
@andreaskaris
andreaskaris force-pushed the fix/issue664 branch 3 times, most recently from 1b074bc to 5c4c550 Compare August 6, 2026 13:00
@andreaskaris

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Comment thread e2etests/tests/resiliency.go Outdated
}
}

// eval evaluates the trafficTestResult. We are conservative and allow for up to

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.

doesn't this mean we are more forgiving now?

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.

I rephrased that comment

@andreaskaris
andreaskaris marked this pull request as draft August 6, 2026 13:37
@andreaskaris
andreaskaris marked this pull request as ready for review August 6, 2026 15:10
@andreaskaris andreaskaris reopened this Aug 6, 2026
@andreaskaris andreaskaris reopened this Aug 6, 2026
Comment thread e2etests/tests/resiliency.go Outdated

// eval evaluates the trafficTestResult. In order to reduce flakes, we allow for up to 40 failures,
// Meaning that with a tick interval of 500ms, we allow up to ca. 20 seconds of downtime.
// We need to be a bit more lenient here as depending on the reconcile timing, BGP sessions might take a while to

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.

@maiqueb is this too much for your migration target?
If so, we need to understand if either we have a bug or we need to tighten up the tests

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.

20 seconds of downtime is not acceptable for virt.

I think we need to better understand the error pattern before allowing the tests to be more lenient.

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.

the test did allow for 2.3 * 5 = ca. 12 seconds, so I'll tweak it to that value

measureTrafficLoss did not use a fixed interval for when it ran its
tests. Meaning that if a curl hung, each run would happen at ca.
2 seconds + 300 ms. Use a 500ms ticker instead and cap the curl at
400ms. Set maxAllowedFailures to 26 to allow for a maximum ~12 seconds
of downtime which is close to the max downtime from the earlier version.
Also make sure that traffic actually works again before stopping and
counting.

Signed-off-by: Andreas Karis <ak.karis@gmail.com>
Reported-at: openperouter#664
@andreaskaris
andreaskaris marked this pull request as draft August 10, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants