Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make tests faster, by reducing timeout margins#516

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
fabianfett wants to merge1 commit intoswift-server:main
base:main
Choose a base branch
Loading
fromfabianfett:ff-make-tests-faster

Conversation

@fabianfett
Copy link
Member

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

  • Reduce connection timeout numbers from 10sec (default) down to 2sec (explicit)
  • Clean up a number of tests. (Removed last instance of should fail)

Result

Faster and cleaner tests

@fabianfettfabianfett added the semver/noneNo version bump required. labelDec 4, 2021
@fabianfett
Copy link
MemberAuthor

Nightly fails because of Sendable requirements.

tlsConfiguration:nil,
clientConfiguration:.init(proxy:.socksServer(host:"127.0.0.1", port: server!.localAddress!.port!)),
clientConfiguration:.init(
timeout:.init(connect:.seconds(3), read:nil),
Copy link
Collaborator

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?

Copy link
Collaborator

@dnadobadnadoba left a 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 anEmbeddedEventLoop in combination withadvanceTime(to:). With that we should be able to reduce test time to a couple of milliseconds and make it independent of actual time passing.

@fabianfett
Copy link
MemberAuthor

fabianfett commentedDec 6, 2021
edited
Loading

Nevertheless, I think the end goal should be to use an EmbeddedEventLoop in combination with advanceTime(to:).

While I agree in general, I'm not sure this actually works for integration tests. In all our unit tests, we should already be usingEmbeddedEventLoop or just being able to call some timeout method (in the state machine tests)

@fabianfett
Copy link
MemberAuthor

@swift-server-bot test please.

@dnadoba
Copy link
Collaborator

@swift-server-bot test this please

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dnadobadnadobadnadoba approved these changes

Assignees

No one assigned

Labels

semver/noneNo version bump required.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@fabianfett@dnadoba

[8]ページ先頭

©2009-2025 Movatter.jp