Skip to content

chore: create test client at lowest Parallel level - #6521

Merged
jedevc merged 1 commit into
dagger:mainfrom
jedevc:avoid-client-in-parallel
Jan 29, 2024
Merged

jedevc merged 1 commit into
dagger:mainfrom
jedevc:avoid-client-in-parallel

Conversation

@jedevc

@jedevc jedevc commented Jan 29, 2024

Copy link
Copy Markdown
Contributor

We should avoid calling Parallel in a sub-test after creating a client, since it can block for a completely indeterminate amount of time, and in that time, we can end up with a huge number of just unused clients.

Not only is this (really only a) little wasteful, it makes stack traces and dumps in the case of test timeout very hard to decipher. Are we waiting for a client because it got deadlocked? Or because it was open since the beginning of the test run.

We do this in two ways:

  • Moving client initialization to right below the deepest t.Parallel call
  • Removing instances of t.Parallel from calls that we do not expect to take very long

We should avoid calling Parallel in a sub-test *after* creating a
client, since it can block for a completely indeterminate amount of
time, and in that time, we can end up with a huge number of just unused
clients.

Not only is this (really only a) little wasteful, it makes stack traces
and dumps in the case of test timeout very hard to decipher. Are we
waiting for a client because it got deadlocked? Or because it was open
since the beginning of the test run.

Signed-off-by: Justin Chadwell <[email protected]>
@jedevc
jedevc requested a review from vito January 29, 2024 17:34
@jedevc

jedevc commented Jan 29, 2024 •

Copy link
Copy Markdown
Contributor Author

Hm, the test job ran at 16m41s which is slower than usual. Giving it a kick to see if that's a one off (and I do nothing else), or if it's consistent, and then we probably need to create some more clients.

Oop, no it looks like other jobs at the same kind of time finished in 17m5s: https://github.com/dagger/dagger/actions/runs/7700243325. Should be fine.

@jedevc
jedevc marked this pull request as ready for review January 29, 2024 18:04
@jedevc
jedevc requested a review from helderco January 29, 2024 18:05
@jedevc

jedevc commented Jan 29, 2024

Copy link
Copy Markdown
Contributor Author

@jedevc
jedevc merged commit efc2457 into dagger:main Jan 29, 2024
@jedevc
jedevc deleted the avoid-client-in-parallel branch January 29, 2024 19:39
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.

2 participants