# test: Fix windows_spawn tmp directory cleanup · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/1a455b2dd8b45fe197fcac7abb9816f5518f6ccd)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 1a455b2dd8b45fe197fcac7abb9816f5518f6ccd

Requested commit: 1a455b2dd8b45fe197fcac7abb9816f5518f6ccd

Commit: 1a455b2dd8b45fe197fcac7abb9816f5518f6ccd

Tree: cbd0e7991fc84cb293aa22a1251592bc14e40a59

Author: xEgoist

Committer: Veikka Tuominen

## Message

```
test: Fix windows_spawn tmp directory cleanup

On Windows, a directory that's set as the current working directory is
not allowed to be removed. This can cause error on `deleteTree` if the
CWD is set to the file to be removed and will cause `error.FileBusy`.
However, due to `tmp.cleanup()` ignoring the errors, the folder removal error will
be ignored. The only test violating this is `windows_spawn`. As a
solution, setting the parent directory to be the CWD before deletion
will allow the cleanup to pass.

```

## Parents

- [396bd51c4818752f6309ff10f2d316f41598d5cd](https://git.cafe/gitcafe/zig/commit/396bd51c4818752f6309ff10f2d316f41598d5cd?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/1a455b2dd8b45fe197fcac7abb9816f5518f6ccd?format=markdown)
