fix: correct context cancellation in waitForState to fix flaky test#7547
Conversation
Signed-off-by: RokeshVS <[email protected]>
|
Thank you for your contribution! 🙏 Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected. While you are waiting, make sure to:
Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient. Learn more about our contribution guide. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Signed-off-by: RokeshVS <[email protected]>
Co-authored-by: Rick Brouwer <[email protected]> Signed-off-by: RokeshVS <[email protected]>
Signed-off-by: RokeshVS <[email protected]>
Co-authored-by: Rick Brouwer <[email protected]> Signed-off-by: RokeshVS <[email protected]>
Signed-off-by: Rick Brouwer <[email protected]>
|
/run-e2e external |
Signed-off-by: Rick Brouwer <[email protected]>
|
/run-e2e external |
|
Hi @RokeshVS The issue still exists, so unfortunately it has not yet been resolved. Do you see a chance to take another look at this? See: https://github.com/kedacore/keda/actions/runs/23997664144/job/69988405523?pr=7606 |
|
Hi @rickbrouwer , Thank you for flagging that the issue still existed after #7547 was merged. I have investigated the root cause further and raised a new PR to address the remaining race condition in The previous fix corrected the
The new PR fixes this by calling Validated with PR - #7635 Would appreciate your review when you get a chance. Thank you! |
… external scaler (kedacore#7547) Signed-off-by: RokeshVS <[email protected]> Signed-off-by: Rick Brouwer <[email protected]> Co-authored-by: Rick Brouwer <[email protected]> Signed-off-by: jansworld <[email protected]>
Description
Fixes the flaky
TestWaitForStatetest inpkg/scalers/external_scaler_test.go.Change 1 —
external_scaler.go(bug fix)waitForStatehadcontinueinstead ofreturnwhen the context was cancelled.This caused the goroutine to spin forever, blocking the test indefinitely.
Change 2 —
external_scaler_test.go(timeout fix)The
selecttimeout of1swas too tight. AfterGracefulStop(), the gRPCclient occasionally takes slightly over
1sto transition toSHUTDOWNstate.Increased to
5sto give sufficient headroom.Result
Ran the test 10 times consecutively — all pass consistently:
Checklist
Fixes #7542