You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reset the working directory of child processes we spawn on Windows. (#1212)
This PR modifies the Windows implementation of `spawnProcess()` so that
it sets the working directory of the new process to "C:\" (or
thereabouts). This prevents a race condition on Windows because that
system won't let you delete a directory if it's the working directory of
any process. See [The Old New
Thing](https://devblogs.microsoft.com/oldnewthing/20101109-00/?p=12323)
for a very on-the-nose blog post.
Note that we do not specify the value of the working directory in an
exit test body. A test should generally not rely on it anyway because it
is global state and any thread could change its value at any time.
I haven't written a unit test for this change because it's unclear what
I could write that would be easily verifiable, and because I don't know
what state I might perturb outside such a test by calling
`SetCurrentDirectory()`.
Resolves#1209.
(This is a speculative fix.)
### Checklist:
- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
0 commit comments