test: accept platform auto-abort in test_actor_charge_limit#944
Open
vdusek wants to merge 2 commits into
Open
Conversation
Hitting max_total_charge_usd makes the platform auto-abort the run, which races with the Actor's clean exit, so the terminal status is non-deterministically SUCCEEDED or ABORTED; accept both.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #944 +/- ##
=======================================
Coverage 86.87% 86.87%
=======================================
Files 48 48
Lines 2942 2942
=======================================
Hits 2556 2556
Misses 386 386
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The E2E test
test_actor_charge_limitwas flaky: it asserted the run ended asSUCCEEDED, but occasionally observedABORTED(e.g. this CI run).Root cause
When an Actor reaches its
max_total_charge_usdceiling, the platform automatically aborts the run ("Aborted automatically after reaching the maximum cost of the run $0.20"). That auto-abort races with the Actor's own clean exit (exit_code 0), so the terminal status is non-deterministicallySUCCEEDEDorABORTED. It's a platform-side timing race, not an SDK or test-logic bug — the actual behavior under test (the charge limit capping the run at exactly 2 of the 4 attempted events) held fine in both outcomes.Fix
Accept both
SUCCEEDEDandABORTEDas valid terminal statuses, keying the wait/assert oncharged_event_counts == {'foobar': 2}(the real invariant).