Repository navigation
fix: flake on TestSSHAuthSockPathHandling test - #8574
Conversation
When testing the TestSSHAuthSockPathHandling, Alex encountered rightfully a flake on this test, leading to this error: ``` Error: module at source dir "" doesn't exist or is invalid ``` It turns out that the error comes from the tests being run in parallel whilst relying on the same client Signed-off-by: Guillaume de Rouville <[email protected]>
|
The error message you were getting here is very weird, poked around and realized that if you look in the engine logs you actually can see: So I think this is actually related to #8385 The reason the error message ends up being
I'll keep poking at this for a few in parallel with you since it turns out to be one the good flakes that are actually reproducible locally 🎉 If it comes down to it, I'm totally fine merging this PR as is to avoid the flakes. These nested exec setups are not anything close to what real world users would do, so it's not a huge loss of test coverage if we just avoid whatever this problem is by giving each test case its own client. Worth a little bit of effort to dig into though in case it reveals any problems that are user-facing after all though. |
|
After some println debugging, the problem appears to be that when concurrent requests are made by the clients, sometimes only one of the So that all adds up: a client never executes You can also see this by running the tests with I think the reason only one of the clients actually executes The last thing I don't understand is the fact that when I marked
Overall, I don't think it's really productive for us to care about any of this. These requirements for making some API calls impure because there could technically be multiple nested clients in the same session using the same paths for different resources is something that exists only inside our test framework, not the real world. So we are honestly better off ignoring things like this for now IMO rather than going down unnecessary rabbit holes (we have plenty of necessary rabbit holes first). @grouville tl;dr lets go with just giving each test case its own client, as you did in this PR. It might be worth a minute of your time to check if any of the other SSH socket related tests are sharing a dagger client and make the same change to this ones. cc @vito (related to impurity, caching and all that fun stuff if you're in the mood) |
sipsma
left a comment
There was a problem hiding this comment.
LGTM, with added suggestion mentioned in other comment that it might be worth making the same change to the other SSH socket related test cases if needed.
|
Ohhh @sipsma could it be because the socket access only actually occurs in Still seems good to me though, but also... confused. I feel like this only started appearing yesterday, about when I merged #8318. But really really unsure as to why this would have any effect at all. |
When testing the TestSSHAuthSockPathHandling, Alex encountered rightfully a flake on this test, leading to this error: ``` Error: module at source dir "" doesn't exist or is invalid ``` It turns out that the error comes from the tests being run in parallel whilst relying on the same client Signed-off-by: Guillaume de Rouville <[email protected]> Co-authored-by: Guillaume de Rouville <[email protected]>
Closes #8571
When testing the TestSSHAuthSockPathHandling, Alex encountered rightfully a flake on this test, leading to this error:
It turns out that the error comes from the tests being run in parallel whilst relying on the same client
More context here. After the change, no flake after 30 runs on my side
The very reason that it sometimes work would be that one of the test sets the nested SESSION's env vars prior the second one's erasing the HOME var, or before ?