Skip to content
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

Fix tests failing due to directory conflicts #533

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

ace-n-msft
Copy link
Contributor

Problem

When running npx run jasmine on the main branch, I receive several instances of the following error:

DELETE ERROR Error: EBUSY: resource busy or locked, rmdir '\\?\C:\Users\a\Desktop\PowerBI-visuals-tools\spec\.tmp\visualname'
    at rmdirSync (node:fs:1222:10)
    at _rmdirSync (node:internal/fs/rimraf:235:5)
    at rimrafSync (node:internal/fs/rimraf:193:7)
    at node:internal/fs/rimraf:253:9
    at Array.forEach (<anonymous>)
    at _rmdirSync (node:internal/fs/rimraf:250:7)
    at rimrafSync (node:internal/fs/rimraf:193:7)
    at Object.rmSync (node:fs:1271:10)
    at Object.removeSync (C:\Users\a\Desktop\PowerBI-visuals-tools\node_modules\fs-extra\lib\remove\index.js:11:6)
    at FileSystem.deleteTempDirectory (file:///C:/Users/a/Desktop/PowerBI-visuals-tools/spec/helpers/FileSystem.js:103:16) {
  errno: -4082,
  syscall: 'rmdir',
  code: 'EBUSY',
  path: '\\\\?\\C:\\Users\\a\\Desktop\\PowerBI-visuals-tools\\spec\\.tmp\\visualname'
}

From my investigation, this seems to be happening due to multiple [conflicting] concurrent file-write operations on the test's temporary directory.

Proposed Solution

To resolve this, I assigned each test its own unique subdirectory within the temporary directory.

I confirmed this resolution worked by running npx jasmine and verifying that the tests passed without issue.

@ace-n-msft ace-n-msft force-pushed the defrag-tests branch 3 times, most recently from 94c912f to d2a89cd Compare February 4, 2025 18:29
@ace-n-msft
Copy link
Contributor Author

ace-n-msft commented Feb 4, 2025

(Note: the force-pushes were necessary to get these commits signed by Git. No code changes occurred post-approval.)

@AleksSavelev AleksSavelev merged commit 086c707 into microsoft:main Feb 5, 2025
5 checks passed
@ace-n-msft ace-n-msft deleted the defrag-tests branch February 5, 2025 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants