Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky apiserver unit test #28715

Merged

Conversation

sblumenthal
Copy link
Contributor

What does this PR do?

Fix flaky TestUnbundledEventsTransform/unbundled_events_by_Kind:ReplicaSet_and_Reason:Killing,SuccessfulDelete test

Motivation

A change introduced by this PR also modified the test cases to validate that the bug was fixed. In doing so, another expected event was added to the expected event list, which contained a title that was already present in the list: Events from the Pod default/squirtle-8fff95dbb-tsc7v.

The test code sorts the output by event title, but sort.Slice does not guarantee that order will be preserved in the case of a collision, which is what is happening here. The end result is the test sometimes succeeds, when the ordering matches what is defined in the list, and sometimes fails, when the ordering is incorrect.

This PR changes the call from sort.Slice to sort.SliceStable, which should preserve the ordering in the event of a collision

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

@sblumenthal sblumenthal added team/containers changelog/no-changelog qa/done Skip QA week as QA was done before merge and regressions are covered by tests labels Aug 23, 2024
@sblumenthal sblumenthal added this to the 7.58.0 milestone Aug 23, 2024
@sblumenthal sblumenthal requested a review from a team as a code owner August 23, 2024 16:57
@pr-commenter
Copy link

pr-commenter bot commented Aug 23, 2024

Regression Detector

Regression Detector Results

Run ID: 81340902-f9bd-4233-aaff-fe1a68a12229 Metrics dashboard Target profiles

Baseline: 71768e8
Comparison: 4ea53fb

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI links
tcp_syslog_to_blackhole ingress throughput +4.65 [-8.70, +18.00] Logs
uds_dogstatsd_to_api_cpu % cpu utilization +0.86 [+0.07, +1.66] Logs
idle memory utilization +0.28 [+0.25, +0.31] Logs
tcp_dd_logs_filter_exclude ingress throughput +0.00 [-0.01, +0.01] Logs
uds_dogstatsd_to_api ingress throughput +0.00 [-0.00, +0.00] Logs
otel_to_otel_logs ingress throughput -0.30 [-1.11, +0.50] Logs
file_tree memory utilization -0.41 [-0.48, -0.34] Logs
basic_py_check % cpu utilization -1.22 [-3.85, +1.42] Logs
pycheck_lots_of_tags % cpu utilization -2.69 [-5.05, -0.33] Logs

Bounds Checks

perf experiment bounds_check_name replicates_passed
idle memory_usage 10/10

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

@sblumenthal
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Aug 23, 2024

🚂 MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.

Use /merge -c to cancel this operation!

@dd-devflow
Copy link

dd-devflow bot commented Aug 23, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in main is 22m.

Use /merge -c to cancel this operation!

@dd-mergequeue dd-mergequeue bot merged commit 1ad6dda into main Aug 23, 2024
249 of 257 checks passed
@dd-mergequeue dd-mergequeue bot deleted the sblumenthal/CONTINT-4382-fix-flaky-apiserver-test branch August 23, 2024 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog qa/done Skip QA week as QA was done before merge and regressions are covered by tests team/containers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants