Skip to content

Conversation

@philipphofmann
Copy link
Member

@philipphofmann philipphofmann commented Sep 29, 2025

Ensure that the test server is running with a retry mechanism to avoid flakiness in CI.

#skip-changelog


Note

Adds a retry-based test server readiness check and stabilizes network integration tests with task cancellation, expectation tweaks, longer timeouts, and stricter assertions.

  • Tests (SentryNetworkTrackerIntegrationTestServerTests.swift):
    • Server readiness: Add ensureTestServerIsRunning() to poll http://localhost:8080/ with retries before tests run.
    • Stability tweaks:
      • Add defer { dataTask.cancel() } in requests and set expect.assertForOverFulfill = false to avoid double-fulfillment.
      • Increase wait timeouts from 5 to 10 seconds.
      • For failed request test: set expect.expectedFulfillmentCount = 2 and fulfill in completion handler.
    • Stronger assertions: Use XCTUnwrap for context.response and status_code and compare extracted statusCode to 400.

Written by Cursor Bugbot for commit a7604f8. This will update automatically on new commits. Configure here.

Closes #6301

Ensure that the test server is running with a retry mechanism to avoid
flakiness in CI.
cursor[bot]

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.785%. Comparing base (7d88965) to head (a7604f8).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #6300       +/-   ##
=============================================
+ Coverage   86.742%   86.785%   +0.042%     
=============================================
  Files          438       438               
  Lines        37323     37323               
  Branches     17433     17437        +4     
=============================================
+ Hits         32375     32391       +16     
+ Misses        4902      4887       -15     
+ Partials        46        45        -1     

see 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d88965...a7604f8. Read the comment docs.

@philipphofmann philipphofmann marked this pull request as draft September 29, 2025 08:25
@philipphofmann
Copy link
Member Author

Back to draft cause tests are failing

@philipphofmann philipphofmann marked this pull request as ready for review September 29, 2025 13:35
@philipphofmann philipphofmann changed the title test: Ensure test server running test: Ensure test is server running Sep 29, 2025
@philipphofmann philipphofmann merged commit 15c8f13 into main Sep 30, 2025
138 of 140 checks passed
@philipphofmann philipphofmann deleted the test/test-server-retry branch September 30, 2025 04:26
philipphofmann added a commit that referenced this pull request Oct 10, 2025
Ensure that the test server is running with a retry mechanism to avoid
flakiness in CI.
itaybre added a commit that referenced this pull request Oct 30, 2025
* test: Ensure test is server running (#6300)

Ensure that the test server is running with a retry mechanism to avoid
flakiness in CI.

* ci: Add v8.x branch to workflows (#6321)

* chore: Explain v8 branch (#6323)

Add decision log entry for v8 branch and explain how to release from it.

* ci(v8): Bump Xcode from 26.0 to 26.0.1 (#6394)

* docs: Add note to README with reference to v9 on main branch (#6402)

* fix: Wrong Frame Delay when becoming active (#6393)

The SDK reported false frame delay statistics when it moved from the
background to the foreground, which also led to falsely reported app
hangs.

Fixes GH-6345

* fix(session-replay): Add detection for potential PII leaks disabling session replay (#6389)

* release: 8.57.0

* chore: Bump simulators to 26.1 (#6578)

* fix: Fix crash when last replay info is missing some keys (#6577)

* fix: Fix crash when last replay info is missing keys

* Update changelog

* fix: Disable SessionSentryReplayIntegration if the environment is unsafe (#6573)

* fix: Disable SessionSentryReplayIntegration if the environment is unsafe

* Simplify shouldEnableSessionReplay

* Rename test

* Add log message

* Update changelog

* Safely unwrap SentryOptions

* fix: Fix UITouch background thread access in SentryTouchTracker (#6584)

* release: 8.57.1

* Fix merge issues

* Fix another merge issue

* More merge conflicts

* Add SentryThreadInspector again

* Fix tests on iOS 26

* Add `enableSessionReplayInUnreliableEnvironment`

---------

Co-authored-by: Philipp Hofmann <[email protected]>
Co-authored-by: Philip Niedertscheider <[email protected]>
Co-authored-by: getsentry-bot <[email protected]>
Co-authored-by: getsentry-bot <[email protected]>
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.

test: Ensure test server running

3 participants