Skip to content

Commit

Permalink
fix: handle race condition with windows and the cri client
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthemanuel committed Apr 13, 2022
1 parent 97a1f3c commit d74642b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/server/lib/browsers/browser-cri-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,14 @@ export class BrowserCriClient {
const versionInfo = await CRI.Version({ host: HOST, port })
const browserClient = await create(versionInfo.webSocketDebuggerUrl, onAsynchronousError)

const browserCriClient = new BrowserCriClient(browserClient, versionInfo, port, onAsynchronousError)

const { targetInfos: targets } = await browserClient.send('Target.getTargets')

if (targets.length === 0) {
await browserCriClient.close()
await browserClient.close()
throw new Error('Could not find any targets in browser')
}

return browserCriClient
return new BrowserCriClient(browserClient, versionInfo, port, onAsynchronousError)
} catch (err) {
retryIndex++
const delay = _getDelayMsForRetry(retryIndex, browserName)
Expand Down

3 comments on commit d74642b

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d74642b Apr 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.0.0/linux-x64/ryanm/fix/windows-cri-client-d74642b853c14c2aede82da12e2f7dc68bddd8b8/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d74642b Apr 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.0.0/darwin-x64/ryanm/fix/windows-cri-client-d74642b853c14c2aede82da12e2f7dc68bddd8b8/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d74642b Apr 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.0.0/win32-x64/ryanm/fix/windows-cri-client-d74642b853c14c2aede82da12e2f7dc68bddd8b8/cypress.tgz

Please sign in to comment.