Issue 1:
Context:

Playwright Version: 1.15

running using image: mcr.microsoft.com/playwright:focal

Code Snippet

Sometimes run could be finished this way

2021-09-30T08:31:45.006Z pw:api => browserContext.close started
1) [Desktop Safari] › src/__tests__/zz.spec.ts:21:5 › local run should blabla
Timeout of 42000ms exceeded.
2021-09-30T08:31:53.427Z pw:api => tracing.stopChunk started
2021-09-30T08:31:53.429Z pw:api <= tracing.stopChunk failed
tracing.stopChunk: Must start tracing before stopping
at .../.yarn/unplugged/@playwright-test-npm-1.15.0-7cc1587cea/node_modules/@playwright/test/lib/test/index.js:329:48
at Object._baseTest.extend._setupContextOptionsAndArtifacts.auto [as fn] (....yarn/unplugged/@playwright-test-npm-1.15.0-7cc1587cea/node_modules/@playwright/test/lib/test/index.js:328:40)
at Fixture.teardown (.../.yarn/unplugged/@playwright-test-npm-1.15.0-7cc1587cea/node_modules/@playwright/test/lib/test/fixtures.js:98:7)
at Fixture.teardown (.../.yarn/unplugged/@playwright-test-npm-1.15.0-7cc1587cea/node_modules/@playwright/test/lib/test/fixtures.js:91:40)
at Fixture.teardown (....yarn/unplugged/@playwright-test-npm-1.15.0-7cc1587cea/node_modules/@playwright/test/lib/test/fixtures.js:91:40)
at FixtureRunner.teardownScope (.../.yarn/unplugged/@playwright-test-npm-1.15.0-7cc1587cea/node_modules/@playwright/test/lib/test/fixtures.js:269:11)
at.../.yarn/unplugged/@playwright-test-npm-1.15.0-7cc1587cea/node_modules/@playwright/test/lib/test/workerRunner.js:91:7

Sometimes this way

Error: Assertion error

at assert (.../node_modules/@playwright/test/lib/utils/utils.js:255:21)
at new Dispatcher (.../node_modules/@playwright/test/lib/dispatchers/dispatcher.js:78:23)
at new WebSocketDispatcher (.../node_modules/@playwright/test/lib/dispatchers/networkDispatchers.js:184:5)
at Page.<anonymous> (.../node_modules/@playwright/test/lib/dispatchers/pageDispatcher.js:96:18)
at Page.emit (events.js:315:20)
at FrameManager.onWebSocketRequest (.../node_modules/@playwright/test/lib/server/frames.js:399:24)
at CRSession.<anonymous> (.../node_modules/@playwright/test/lib/server/chromium/crNetworkManager.js:57:1285)
at CRSession.emit (events.js:315:20)
at .../node_modules/@playwright/test/lib/server/chromium/crConnection.js:225:14

Describe the bug

in 1st of examples after the test is succeeded, browserContext.close took at least 8 seconds ( when usually it takes less than a second )

which triggered some fixture error + timeout

not sure about reproducing the issue, but as a hint - there were some network issues and/or some hanging http/ws requests ( which didn't affect the test run )

Issue 2:
Context:

System:

OS: Linux 4.4 Ubuntu 20.04.3 LTS (Focal Fossa)

Memory: 342.80 MB / 5.83 GB

Container: Yes

Binaries:

Node: 14.18.0 - /usr/bin/node

Yarn: 1.22.15 - /usr/bin/yarn

npm: 6.14.15 - /usr/bin/npm

Languages:

Bash: 5.0.17 - /usr/bin/bash

npmPackages:

playwright: ^1.15.2 => 1.15.2

Code Snippet

I'm using the trace configuration below:

retries: 1,
use: {
trace: "on-first-retry",
//...
}

I'm not sharing the actual test code snippet as I experienced the same error with unrelated test codes, so I'm not sure it's the relevant part here.

Describe the bug

First, congratulations for this awesome e2e test platform, it's really great!

About the bug: I'm having the following error from time to time. It happens when retrying a test after a first failure. It seems related to Playwright but I'm not sure.

tracing.startChunk: Must start tracing before starting a new chunk
at onDidCreateContext (/usr/src/tests/e2e/node_modules/@playwright/test/lib/test/index.js:235:31)
at Object._baseTest.extend._setupContextOptionsAndArtifacts.auto [as fn] (/usr/src/tests/e2e/node_modules/@playwright/test/lib/test/index.js:290:40)
at Fixture.setup (/usr/src/tests/e2e/node_modules/@playwright/test/lib/test/fixtures.js:73:73)
at FixtureRunner.setupFixtureForRegistration (/usr/src/tests/e2e/node_modules/@playwright/test/lib/test/fixtures.js:312:5)
at FixtureRunner.resolveParametersAndRunHookOrTest (/usr/src/tests/e2e/node_modules/@playwright/test/lib/test/fixtures.js:284:45)
at WorkerRunner._runHooks (/usr/src/tests/e2e/node_modules/@playwright/test/lib/test/workerRunner.js:516:9)
at WorkerRunner._runBeforeHooks (/usr/src/tests/e2e/node_modules/@playwright/test/lib/test/workerRunner.js:422:7)
at WorkerRunner._runTestWithBeforeHooks (/usr/src/tests/e2e/node_modules/@playwright/test/lib/test/workerRunner.js:442:32)

Would you happen to have a clue of what may cause this?

Thanks! :)