Expected Behavior
The two tests can run correctly in parallel.
Actual Behavior
json-to-hcl.test will occasionally fail with:
FAIL test/json-to-hcl.test.ts (5.73 s)
● pass variables
ENOENT: no such file or directory, lstat 'terraform.OriginStack.tfstate'
135 | */
136 | function copySync(from: string, to: string) {
> 137 | if (fs.lstatSync(from).isDirectory()) {
| ^
138 | fs.mkdirSync(to, { recursive: true });
139 | for (const file of fs.readdirSync(from)) {
140 | copySync(path.join(from, file), path.join(to, file));
at lstatSync (lib/terraform-module-asset.ts:137:10)
at copySync (lib/terraform-module-asset.ts:140:7)
at new copySync (lib/terraform-module-asset.ts:65:7)
at Function.of (lib/terraform-module-asset.ts:81:15)
at new of (lib/terraform-module.ts:59:44)
at new TerraformHclModule (lib/terraform-hcl-module.ts:16:5)
at Object.<anonymous> (test/json-to-hcl.test.ts:973:3)
Steps to Reproduce
- Run
lerna run --scope 'cdktn' test:ci
- Every so often that will fail
Possible Solutions
Make sure different directories are used during the two tests to isolate effects.
Anything Else?
I believe this is caused by a race condition where the json-to-hcl test can detect the outputs of the running app.test when it is initially determining assets, but then those assets are removed when copying the assets.
References
Help Wanted
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Expected Behavior
The two tests can run correctly in parallel.
Actual Behavior
json-to-hcl.testwill occasionally fail with:Steps to Reproduce
lerna run --scope 'cdktn' test:ciPossible Solutions
Make sure different directories are used during the two tests to isolate effects.
Anything Else?
I believe this is caused by a race condition where the
json-to-hcltest can detect the outputs of the runningapp.testwhen it is initially determining assets, but then those assets are removed when copying the assets.References
Help Wanted
Community Note