Skip to content

test: clear leftover queue files before each ignoredExceptionTypes capture test - #920

Merged
turnipdabeets merged 2 commits into
mainfrom
test/ignored-types-leftover-queue
Oct 7, 2026
Merged

turnipdabeets merged 2 commits into
mainfrom
test/ignored-types-leftover-queue

Conversation

@turnipdabeets

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

ErrorTracking ignoredExceptionTypes capture paths is flaky on the iOS simulator job. captureException still drops ignored types… sometimes sees one $exception event (e.g. this run).

The test before it captures a non-ignored $exception. getBatchedEvents returns once the mock receives the batch, which can be before the SDK deletes the sent file, and storage.reset() intentionally keeps the event queue. So that event can still be on disk when the next test's SDK starts with the same token, and it gets sent again.

getSut now clears the app-support directory first, same as PostHogSDKPersonProfilesTest.

💚 How did you test it?

make test filter=ErrorTrackingIgnoredTypes passed 3/3 locally (macOS). It's a timing race, so this shows the change doesn't break anything, not that the flake is gone.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Claude Code found the cause in the iOS simulator test log on #903 and applied the fix. The same race exists on main, so it's fixed here directly instead of waiting for the v4 chain to merge. Test-only change, no changeset.

🤖 Generated with Claude Code

…pture test

storage.reset() keeps the event queue, and getBatchedEvents returns once the
mock receives a batch, before the SDK deletes the sent file. The previous
test's $exception could survive on disk and be resent by the next SDK,
failing the "drops ignored types" assertion on the iOS simulator job.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@turnipdabeets
turnipdabeets requested a review from a team as a code owner October 7, 2026 18:57
@turnipdabeets turnipdabeets self-assigned this Oct 7, 2026
@turnipdabeets
turnipdabeets enabled auto-merge (squash) October 7, 2026 19:16
The migration test slept a fixed 150ms after unblocking the background
migration, which a slow CI simulator can outrun. Off the main thread
migration runs inline inside add(), so signal once add() returns and
wait on that.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@turnipdabeets
turnipdabeets merged commit af0dec1 into main Oct 7, 2026
46 checks passed
@turnipdabeets
turnipdabeets deleted the test/ignored-types-leftover-queue branch October 7, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants