ci: fix Actions not running sometimes (#10503)

This commit is contained in:
Nikolay Vitkov 2023-07-04 14:17:25 +02:00 committed by GitHub
parent 15cf3a5e6d
commit 0d2c42a1c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 14 deletions

View File

@ -12,7 +12,7 @@ on:
- '**' - '**'
concurrency: concurrency:
group: ${{ github.head_ref || github.run_id }} group: ci-${{ github.head_ref || github.run_id }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:

View File

@ -8,7 +8,7 @@ on:
types: [labeled] types: [labeled]
concurrency: concurrency:
group: ${{ github.head_ref || github.run_id }} group: devtools-${{ github.head_ref || github.run_id }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:

View File

@ -7,7 +7,7 @@ on:
types: [opened, reopened, edited] types: [opened, reopened, edited]
concurrency: concurrency:
group: ${{ format('issue-{0}', github.event.issue.number) }} group: issue-${{ format('issue-{0}', github.event.issue.number) }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:

View File

@ -255,20 +255,33 @@ process.on('unhandledRejection', reason => {
const browserNotClosedError = new Error( const browserNotClosedError = new Error(
'A manually launched browser was not closed!' 'A manually launched browser was not closed!'
); );
export const mochaHooks = { export const mochaHooks = {
async beforeAll(): Promise<void> { async beforeAll(): Promise<void> {
const {server, httpsServer} = await setupServer(); async function setUpDefaultState() {
const {server, httpsServer} = await setupServer();
state.puppeteer = puppeteer; state.puppeteer = puppeteer;
state.server = server; state.server = server;
state.httpsServer = httpsServer; state.httpsServer = httpsServer;
state.isFirefox = processVariables.isFirefox; state.isFirefox = processVariables.isFirefox;
state.isChrome = processVariables.isChrome; state.isChrome = processVariables.isChrome;
state.isHeadless = processVariables.isHeadless; state.isHeadless = processVariables.isHeadless;
state.headless = processVariables.headless; state.headless = processVariables.headless;
state.puppeteerPath = path.resolve( state.puppeteerPath = path.resolve(
path.join(__dirname, '..', '..', 'packages', 'puppeteer') path.join(__dirname, '..', '..', 'packages', 'puppeteer')
); );
}
try {
await Deferred.race([
setUpDefaultState(),
Deferred.create({
message: `Failed in after Hook`,
timeout: (this as any).timeout() - 1000,
}),
]);
} catch {}
}, },
async afterAll(): Promise<void> { async afterAll(): Promise<void> {