Skip to content

test: accept platform auto-abort in test_actor_charge_limit#944

Open
vdusek wants to merge 2 commits into
masterfrom
test/deflake-actor-charge-limit
Open

test: accept platform auto-abort in test_actor_charge_limit#944
vdusek wants to merge 2 commits into
masterfrom
test/deflake-actor-charge-limit

Conversation

@vdusek
Copy link
Copy Markdown
Contributor

@vdusek vdusek commented Jun 5, 2026

Description

The E2E test test_actor_charge_limit was flaky: it asserted the run ended as SUCCEEDED, but occasionally observed ABORTED (e.g. this CI run).

Root cause

When an Actor reaches its max_total_charge_usd ceiling, 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-deterministically SUCCEEDED or ABORTED. 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 SUCCEEDED and ABORTED as valid terminal statuses, keying the wait/assert on charged_event_counts == {'foobar': 2} (the real invariant).

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.
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Jun 5, 2026
@vdusek vdusek self-assigned this Jun 5, 2026
@github-actions github-actions Bot added this to the 142nd sprint - Tooling team milestone Jun 5, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jun 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.87%. Comparing base (3f25d4a) to head (e2e50c5).

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           
Flag Coverage Δ
e2e 37.76% <ø> (ø)
integration 59.10% <ø> (ø)
unit 75.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek marked this pull request as ready for review June 5, 2026 15:32
@vdusek vdusek requested a review from janbuchar June 5, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants