Skip to content

chore: Speed up port-forward tests #3062

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

Merged
merged 2 commits into from
Jul 20, 2022
Merged

Conversation

mafredri
Copy link
Member

I've been looking at some CI test timeout test failures, and whilst I haven't gotten to the bottom of it, I thought we could significantly increase the speed of the port-forward tests. On my machine the test time went from ~30s to ~5s, should be a bigger gain in CI.

  • chore: Speed up port-forward tests
  • chore: Add t.Helper and ensure listener closure on error

@mafredri mafredri self-assigned this Jul 20, 2022
@mafredri mafredri requested review from deansheather and a team July 20, 2022 13:12
client = coderdtest.New(t, &coderdtest.Options{IncludeProvisionerD: true})
user = coderdtest.CreateFirstUser(t, client)
_, workspace = runAgent(t, client, user.UserID)
)
Copy link
Member Author

Choose a reason for hiding this comment

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

Note this change: We now share coderd/agent between tests. I didn't see any reason not-to.

Copy link
Contributor

Choose a reason for hiding this comment

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

this will be an interesting test of how useful our logging messages are, since we're sharing a logger among multiple things happening at once (just like in a real deployment 😰 )

Copy link
Member Author

Choose a reason for hiding this comment

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

That's an interesting point I did not think of. We'll also be sharing the parent *testing.T 😮. To be fair, with regards to test logging, I rarely find them helpful due to the verbosity / parallel execution. 😂

Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

Smart!

Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

Mean't to approve.

Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

Nice!

@mafredri mafredri merged commit 034416f into main Jul 20, 2022
@mafredri mafredri deleted the mafredri/speed-up-portforward-test branch July 20, 2022 15:11
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.

4 participants