Skip to content

withinSandbox may fail to create sandbox directory due to non-unique name #166

@mcmire

Description

@mcmire

withinSandbox creates a temporary directory using the current timestamp, and throws if the directory already exists. This will inevitably cause a problem if two tests that use withinSandbox are running at the same time (which is likely if they are located in two separate files and you are running the entire test suite for a project, since Jest runs multiple files in parallel). The result is that the aforementioned error will appear, or strangely, the directory will fail to get removed.

To fix this, we should assign a unique name to the temporary directory.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions