From 7e59bf92f3a3dc143f1f51ab7341ce5f6c7247ad Mon Sep 17 00:00:00 2001 From: Zach Bloomquist Date: Fri, 9 Dec 2022 16:30:18 -0500 Subject: [PATCH] retry video compression in wk --- system-tests/lib/system-tests.ts | 4 +++- system-tests/test/video_compression_spec.js | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/system-tests/lib/system-tests.ts b/system-tests/lib/system-tests.ts index 0a7ced4f428e..fa5ae7162b34 100644 --- a/system-tests/lib/system-tests.ts +++ b/system-tests/lib/system-tests.ts @@ -55,6 +55,7 @@ export type ItOptions = ExecOptions & { * If a function is supplied, it will be executed instead of running the `systemTests.exec` function immediately. */ onRun?: ( + this: Mocha.Context, execFn: ExecFn, browser: BrowserName ) => Promise | any @@ -528,7 +529,8 @@ const localItFn = function (title: string, opts: ItOptions) { return systemTests.exec(ctx, _.extend({ originalTitle }, options, overrides, { browser })) } - return options.onRun(execFn, browser, ctx) + // pass Mocha's this context to onRun + return options.onRun.call(this, execFn, browser, ctx) }) } diff --git a/system-tests/test/video_compression_spec.js b/system-tests/test/video_compression_spec.js index 7421bf378c44..4f2d531a30ea 100644 --- a/system-tests/test/video_compression_spec.js +++ b/system-tests/test/video_compression_spec.js @@ -49,7 +49,12 @@ describe('e2e video compression', () => { MS_PER_TEST, }, }, - async onRun (exec) { + async onRun (exec, browserName) { + if (browserName === 'webkit') { + // TODO(webkit): fix video recording flake in webkit + this.retries(15) + } + process.env.VIDEO_COMPRESSION_THROTTLE = 10 const { stdout } = await exec()