test: fix flaky content tracing test (#39682)
This commit is contained in:
parent
f27b034045
commit
4cc0f6fb78
1 changed files with 4 additions and 6 deletions
|
@ -5,8 +5,8 @@ import * as path from 'node:path';
|
||||||
import { setTimeout } from 'node:timers/promises';
|
import { setTimeout } from 'node:timers/promises';
|
||||||
import { ifdescribe } from './lib/spec-helpers';
|
import { ifdescribe } from './lib/spec-helpers';
|
||||||
|
|
||||||
// FIXME: The tests are skipped on arm/arm64 and ia32.
|
// FIXME: The tests are skipped on linux arm/arm64
|
||||||
ifdescribe(!(['arm', 'arm64', 'ia32'].includes(process.arch)))('contentTracing', () => {
|
ifdescribe(!(['arm', 'arm64'].includes(process.arch)) || (process.platform !== 'linux'))('contentTracing', () => {
|
||||||
const record = async (options: TraceConfig | TraceCategoriesAndOptions, outputFilePath: string | undefined, recordTimeInMilliseconds = 1e1) => {
|
const record = async (options: TraceConfig | TraceCategoriesAndOptions, outputFilePath: string | undefined, recordTimeInMilliseconds = 1e1) => {
|
||||||
await app.whenReady();
|
await app.whenReady();
|
||||||
|
|
||||||
|
@ -120,9 +120,7 @@ ifdescribe(!(['arm', 'arm64', 'ia32'].includes(process.arch)))('contentTracing',
|
||||||
|
|
||||||
describe('captured events', () => {
|
describe('captured events', () => {
|
||||||
it('include V8 samples from the main process', async function () {
|
it('include V8 samples from the main process', async function () {
|
||||||
// This test is flaky on macOS CI.
|
this.timeout(60000);
|
||||||
this.retries(3);
|
|
||||||
|
|
||||||
await contentTracing.startRecording({
|
await contentTracing.startRecording({
|
||||||
categoryFilter: 'disabled-by-default-v8.cpu_profiler',
|
categoryFilter: 'disabled-by-default-v8.cpu_profiler',
|
||||||
traceOptions: 'record-until-full'
|
traceOptions: 'record-until-full'
|
||||||
|
@ -131,7 +129,7 @@ ifdescribe(!(['arm', 'arm64', 'ia32'].includes(process.arch)))('contentTracing',
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
let n = 0;
|
let n = 0;
|
||||||
const f = () => {};
|
const f = () => {};
|
||||||
while (Date.now() - start < 200 || n < 500) {
|
while (Date.now() - start < 200 && n < 500) {
|
||||||
await setTimeout(0);
|
await setTimeout(0);
|
||||||
f();
|
f();
|
||||||
n++;
|
n++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue