mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(tracing): return early if no trace was produced (#10953)
This fixes [page/page-set-input-files.spec.ts](https://devops.aslushnikov.com/flakiness2.html#filter_spec=page%2Fpage-set-input-files.spec.ts&commits=50&test_parameter_filters=%5B%5B%22browserName%22%2C%5B%5B%22electron%22%2C%22exclude%22%5D%5D%5D%2C%5B%22platform%22%2C%5B%5B%22Android%22%2C%22exclude%22%5D%5D%5D%2C%5B%22video%22%2C%5B%5Btrue%2C%22exclude%22%5D%5D%5D%2C%5B%22trace%22%2C%5B%5Btrue%2C%22include%22%5D%5D%5D%5D×tamp=1639590204582) failures.
This commit is contained in:
parent
9b488f5a65
commit
fcccac0c08
@ -65,8 +65,12 @@ export class Tracing implements api.Tracing {
|
||||
return;
|
||||
}
|
||||
|
||||
// The artifact may be missing if the browser closed while stopping tracing.
|
||||
if (!result.artifact)
|
||||
return;
|
||||
|
||||
// Save trace to the final local file.
|
||||
const artifact = Artifact.from(result.artifact!);
|
||||
const artifact = Artifact.from(result.artifact);
|
||||
await artifact.saveAs(filePath);
|
||||
await artifact.delete();
|
||||
|
||||
|
@ -840,6 +840,7 @@ BrowserContext:
|
||||
- compressTrace
|
||||
- compressTraceAndSources
|
||||
returns:
|
||||
# The artifact may be missing if the browser closes while tracing is beeing stopped.
|
||||
artifact: Artifact?
|
||||
sourceEntries:
|
||||
type: array?
|
||||
|
Loading…
x
Reference in New Issue
Block a user