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

Bug on restarting debugging on tests for 3rd time #24507

Closed
eleanorjboyd opened this issue Dec 2, 2024 · 0 comments · Fixed by #24611
Closed

Bug on restarting debugging on tests for 3rd time #24507

eleanorjboyd opened this issue Dec 2, 2024 · 0 comments · Fixed by #24611
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team

Comments

@eleanorjboyd
Copy link
Member

Steps:

  1. run tests via debug
  2. have a breakpoint on the test which it hits
  3. using the debugging control bar, click restart 3 times (each time the run again gets stopped at the set breakpoint)
  4. 🐛 on the 3rd time restarting the test, the test will no longer hit the break point, or finish and if you look at the test explorer the UI will still spin

Details on debugging this issue:

I have narrowed down the issue with the fs path check and it is related to the creation of the reader stream but only on mac (fifo related). I tried on windows, and cannot get the bug to occur but both @anthonykim1 and I get it on mac. I narrowed it down to the line const reader = fs.createReadStream(pipeName, { encoding: 'utf-8' }); by running a test. I put the following code before and after the line, and after the line it stalls while before it succeeds:

        for (let i = 0; i < 15; i = i + 1) { 
            const z = await Promise.race([
                fs.pathExists(
                    '/Users/eleanorboyd/vscode-python/src/client/testing/testController/pytest/pytestExecutionAdapter.ts',
                ),
                new Promise((_, reject) => setTimeout(() => reject(new Error('Timeout')), 5000)),
            ]);
            console.log(`META z ith time:`, i, z);
        }

I did this 20+ times in different spots and the before and after this single line and it holds. So it looks like the creation of the reader creates a file lock - or at least causes it to mess up after multiple times. I attempted: changing the reader and writer to only allow for 64 bits of info transferred, only impact is making it stall sooner. I also moved the code which it kept breaking on before the creation of the reader which caused that code to no longer fail, but more code (I assume just more file access since there are so many places that might happen) fail after the reader is created.

@eleanorjboyd eleanorjboyd added area-testing bug Issue identified by VS Code Team member as probable bug labels Dec 2, 2024
@eleanorjboyd eleanorjboyd self-assigned this Dec 2, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Dec 2, 2024
karthiknadig pushed a commit to karthiknadig/vscode-python that referenced this issue Dec 23, 2024
karthiknadig added a commit that referenced this issue Dec 23, 2024
fixes #24594 
fixes #24507

Co-authored-by: Eleanor Boyd <eleanorboyd@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant