-
Notifications
You must be signed in to change notification settings - Fork 316
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
Swap windows jobs to docker (as much as possible) #6603
Conversation
Hello scotthain! Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
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.
this looks good to me. just have 1 thing that needs to change so this can still pass locally
Signed-off-by: Scott Hain <[email protected]>
Signed-off-by: Scott Hain <[email protected]>
Signed-off-by: mwrock <[email protected]>
I've gone and made a few changes to allow tests to succeed in a windows container environment. Here is a summary:
|
This looks great @mwrock - I think you need to reapprove it and then I can merge it if you're ok with it. Thanks for picking up the ball on this!! |
6d666a6
to
b141146
Compare
@@ -822,8 +821,8 @@ mod test_find_command { | |||
fn setup_path() { |
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.
This function modifies global state (via env::set_var
), but will be run by multiple tests concurrently. We should use something like locked_env_var
to make this thread-safe or restructure the tests with dependency injection to not depend on global state. I think the latter would be preferable since it doesn't limit the concurrency potential for the tests.
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.
locked_env_var
is defined in common
so we would have to move it to core and adjust all callers which feels like it belongs in a separate PR.
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.
Yeah, it's overdue to be moved into core
(probably common/core should be merged entirely), but I think it's worth doing now since these tests are prone to non-deterministic failures without it. A separate PR is good, but it could merge before this one so we can base the fix on it.
How about taking the dependency-injection approach? That's the preferable solution in my view and is appropriate to this PR scope.
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.
Including that in here feels to me kinda like scope creep for this PR but I'll defer to you both on it!
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.
I agree that moving locked_env_var
deserves its own PR if we go that way. If we use dependency injection instead, we can make those changes in this PR and leave moving locked_env_var
for later, but either way I think we should not leave this in a subtly broken state which may crop up some unknown time in the future.
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.
In this case, I think even if multiple tests concurrently change this, its harmless. worse that will happen id the fixtures will get added to the path multiple times.
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.
I'm not so sure we can make that strong an assumption about the way env::set_var
works. The documentation says "concurrent access to environment variables is safe in Rust", but that doesn't mean that it will do what you expect. I'm not sure we're guaranteed one thread accessing this in the midst of another thread setting it couldn't result in an empty result.
In any case, it's not a huge deal, but it's an error-prone pattern to rely on global state like this, so when we can switch to something more robust (such as injecting global dependencies as arguments) without a huge hassle, I think we'd be well served to do so.
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.
Looking at this I still think it is out of scope. These tests while not ideal has been in place for 3 years without raising stability issues. I'd just rather not go into refactoring non-test code unrelated to the intent of this PR and get it merged.
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.
In test code, I'm equally or more worried about false positives, but you're right that we can probably let this one go. The value of getting this merged is quite high.
I'm going to defer to @mwrock to answer questions on the rust changes. |
4c0401e
to
14600f0
Compare
Signed-off-by: mwrock <[email protected]>
Signed-off-by: Scott Hain <[email protected]>
Obvious fix; these changes are the result of automation not creative thinking.
Signed-off-by: Scott Hain [email protected]
There are a few jobs that still fail.