From b4a79672cf715163e87a26e64b74b4b37e68b9f2 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 13 Oct 2021 16:52:19 -0400 Subject: [PATCH] test: fix flaky contentTracing.startRecording spec (#31411) Co-authored-by: Cheng Zhao --- spec-main/api-content-tracing-spec.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/spec-main/api-content-tracing-spec.ts b/spec-main/api-content-tracing-spec.ts index 0b92af55b73f9..af9ff01eb8dcc 100644 --- a/spec-main/api-content-tracing-spec.ts +++ b/spec-main/api-content-tracing-spec.ts @@ -52,18 +52,10 @@ ifdescribe(!(['arm', 'arm64'].includes(process.arch)))('contentTracing', () => { }; await record(config, outputFilePath); - expect(fs.existsSync(outputFilePath)).to.be.true('output exists'); - - // If the `excluded_categories` param above is not respected - // the file size will be above 50KB. - const fileSizeInKiloBytes = getFileSizeInKiloBytes(outputFilePath); - const expectedMaximumFileSize = 10; // Depends on a platform. - - expect(fileSizeInKiloBytes).to.be.above(0, - `the trace output file is empty, check "${outputFilePath}"`); - expect(fileSizeInKiloBytes).to.be.below(expectedMaximumFileSize, - `the trace output file is suspiciously large (${fileSizeInKiloBytes}KB), - check "${outputFilePath}"`); + // If the `excluded_categories` param above is not respected, categories + // like `node,node.environment` will be included in the output. + const content = fs.readFileSync(outputFilePath).toString(); + expect(content.includes('"cat":"node,node.environment"')).to.be.false(); }); it('accepts "categoryFilter" and "traceOptions" as a config', async () => {