-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make tests faster, by reducing timeout margins #516
base: main
Are you sure you want to change the base?
Conversation
Nightly fails because of Sendable requirements. |
@@ -76,7 +76,10 @@ class HTTPConnectionPool_FactoryTests: XCTestCase { | |||
let factory = HTTPConnectionPool.ConnectionFactory( | |||
key: .init(request), | |||
tlsConfiguration: nil, | |||
clientConfiguration: .init(proxy: .socksServer(host: "127.0.0.1", port: server!.localAddress!.port!)), | |||
clientConfiguration: .init( | |||
timeout: .init(connect: .seconds(3), read: nil), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we use 3 seconds instead of 2 seconds here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! This will decrease runtime significantly.
Nevertheless, I think the end goal should be to use an EmbeddedEventLoop
in combination with advanceTime(to:)
. With that we should be able to reduce test time to a couple of milliseconds and make it independent of actual time passing.
While I agree in general, I'm not sure this actually works for integration tests. In all our unit tests, we should already be using |
9f4a366
to
09b14a3
Compare
09b14a3
to
05b9d9b
Compare
@swift-server-bot test please. |
@swift-server-bot test this please |
Motivation
We like fast tests. For this reason we enabled parallel testing recently. However there are a number of tests that have unnecessary high timeout margins. If we reduce those tests will be even faster.
Changes
Result
Faster and cleaner tests