-
Notifications
You must be signed in to change notification settings - Fork 75
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] trace viewer opens in empty state while debugging #515
base: main
Are you sure you want to change the base?
Conversation
249d6cd
to
e09b4d1
Compare
e09b4d1
to
f7936e0
Compare
I did not realize this was intended to land first. |
I'll rebase it, no worries. |
9d1a7a9
to
143e22f
Compare
|
||
const testRunPromise = testController.run(); | ||
// wait for test to start | ||
await waitForTestItemStatus(testItem, 'started'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like the next line should take care of it since you are polling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My problem is that the polling fails with timeout, at least in my computer, and that's because tests are taking more than 5 seconds to start.
That waitForTestItemStatus(testItem, 'started')
is just to ensure test is in a state where I have confidence I won't get a timeout while polling.
|
||
test.skip(({ traceViewerMode }) => !traceViewerMode); | ||
|
||
async function waitForTestItemStatus(testItem: TestItem, status: TestItem['status']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not sound like we should need it, it is better to make the assertion that follows a waiting assertion.
tests/mock/vscode.ts
Outdated
@@ -193,6 +193,8 @@ export class TestItem { | |||
tags: readonly TestTag[] = []; | |||
canResolveChildren = false; | |||
status: 'none' | 'enqueued' | 'started' | 'skipped' | 'failed' | 'passed' = 'none'; | |||
_didChangeStatus = new EventEmitter<TestItem>(); | |||
onDidChangeStatus = this._didChangeStatus.event; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this on vscode.TestItem,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll use TestController.onDidCreateTestRun > TestRun.onDidChange
to achieve the same goal.
3879f00
to
ac3a73c
Compare
Rebased it again, and adapted it to new changes. @pavelfeldman I noticed the I had to change the value directly in the code to be able to test it in VS Code. Is there any other way? |
Bug detected in #513 (comment), but it also happens with public releases of playwright / playwright-vscode.
To reproduce:
npm init playwright@latest
has title
Eventually, it will open the trace viewer app showing Select test to see the trace.
This PR tries to fix it by ensuring that trace paths are only associated with corresponding test items when they are not running in debug.
Environment: