Skip to content

Conversation

@philipphofmann
Copy link
Member

@philipphofmann philipphofmann commented Jan 20, 2026

Added make stop-test-server command and clarified that the test server is only needed for 3 specific network integration tests, not the main test suite.

Changes

Makefile:

  • Added stop-test-server target to kill processes on port 8080

AGENTS.md:

  • Removed test server from main test command (make test not make run-test-server && make test)
  • Added "Test Server Requirements" section explaining only Sentry_TestServer xctestplan needs it
  • Listed stop-test-server in helpful commands

Motivation

Test server runs in background without auto-shutdown, causing port conflicts and resource leaks. Only 3 tests in SentryNetworkTrackerIntegrationTestServerTests require it.

#skip-changelog

Closes #7218

Added make stop-test-server command to safely shut down the test
server running on port 8080. Updated AGENTS.md to clarify that the
test server is only needed for 3 specific network integration tests
(Sentry_TestServer xctestplan), not for the main test suite.

This prevents port conflicts and resource leaks by ensuring agents
properly clean up test server processes after use.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@philipphofmann philipphofmann changed the title test: add test server cleanup and clarify usage test: add stop-test-server to Makefile and clarify in AGENTS.md Jan 20, 2026
@philipphofmann philipphofmann added the ready-to-merge Use this label to trigger all PR workflows label Jan 20, 2026
@codecov
Copy link

codecov bot commented Jan 20, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
4407 1 4406 52
View the top 1 failed test(s) by shortest run time
SentryTests.SentryCrashInstallationReporterTests::testFaultyReportIsNotSentAndDeleted
Stack Traces | 0s run time
.../SentryTests/SentryCrash/SentryCrashInstallationReporterTests.swift:77 - XCTAssertEqual failed: ("1") is not equal to ("0")
View the full list of 1 ❄️ flaky test(s)
SentryTests.SentryOnDemandReplayTests::testAddFrameIsThreadSafe

Flake rate in main: 100.00% (Passed 0 times, Failed 38 times)

Stack Traces | 0s run time
.../Integrations/SessionReplay/SentryOnDemandReplayTests.swift:139 - Asynchronous wait failed: Exceeded timeout of 10 seconds, with unfulfilled expectations: "AddFrameIsThreadSafe".

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions
Copy link
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1206.98 ms 1239.37 ms 32.39 ms
Size 24.14 KiB 1.06 MiB 1.04 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
21cd5ba 1218.68 ms 1255.54 ms 36.86 ms
adeec82 1220.43 ms 1254.94 ms 34.51 ms
41b4993 1215.15 ms 1248.14 ms 32.99 ms
2f4ddaa 1227.26 ms 1260.04 ms 32.78 ms
d29a425 1209.96 ms 1239.00 ms 29.04 ms
778dadf 1207.69 ms 1246.09 ms 38.40 ms
b87b34f 1203.00 ms 1237.17 ms 34.17 ms
e1e5f3b 1220.60 ms 1241.63 ms 21.04 ms
93ef486 1220.22 ms 1244.96 ms 24.74 ms
3bf0d3f 1202.12 ms 1237.23 ms 35.11 ms

App size

Revision Plain With Sentry Diff
21cd5ba 24.14 KiB 1.04 MiB 1.02 MiB
adeec82 24.14 KiB 1.04 MiB 1.02 MiB
41b4993 24.14 KiB 1.06 MiB 1.04 MiB
2f4ddaa 24.14 KiB 1.04 MiB 1.02 MiB
d29a425 24.14 KiB 1.04 MiB 1.02 MiB
778dadf 24.14 KiB 1.04 MiB 1.02 MiB
b87b34f 24.14 KiB 1.06 MiB 1.04 MiB
e1e5f3b 24.14 KiB 1.06 MiB 1.04 MiB
93ef486 24.14 KiB 1.06 MiB 1.04 MiB
3bf0d3f 24.14 KiB 1.04 MiB 1.02 MiB

Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comments

Use PID file instead of port-based process killing to safely stop
the test server. This prevents accidentally killing other services
running on port 8080.

Changes:
- Save test server PID to test-server/.test-server.pid on start
- Stop server using saved PID instead of lsof on port 8080
- Add .test-server.pid to test-server/.gitignore
- Improve error messages for better debugging
Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Update test server documentation to use the sentry-xcodebuild.sh
wrapper script instead of raw xcodebuild command. This provides
better consistency with CI and handles platform-specific
configurations automatically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Use this label to trigger all PR workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add test server cleanup and clarify usage

3 participants