Files
threshold-ui/ui/admin/testem.js
T
hashicc 6a46e2dd57 chore: 🤖 add chrome flags to keep from backgrounding (#2714)
There was an issue in tests where events fired in
Hds::FlyOut and Hds::Modal were not being dispatched.
These close events were depended on by test waiters
to know when the element was removed. In recent
versions of chrome, when ran headless and on macos,
these events were not firing. This meant the tests
waited indefinitely on developers local machines,
until the tests timed out. This issue was seen
across multiple macbooks and even on the hds repo.

This issue was *only* experienced in headless
chrome on recent macos.
It was **not** happening in:
* macos chrome headed locally
* linux chrome headless in CI

This made the issue only impact people running tests
locally, getting obscure timeouts. This issue is fixed
by the addition of this flag:
--disable-backgrounding-occluded-windows

The other flags added in this commit are not required
for the fix but should help keep a browser "active",
which was loosely what researching this bug hinted at
the cause of finding the issue fix.
2025-03-11 13:29:19 -04:00

36 lines
1.1 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: ['Chrome'],
launch_in_dev: ['Chrome', 'Firefox'],
browser_start_timeout: 120,
browser_args: {
Chrome: {
ci: [
// --no-sandbox is needed when running Chrome inside a container
process.env.CI ? '--no-sandbox' : null,
'--headless',
// Disable backgrounding renders for occluded windows
'--disable-backgrounding-occluded-windows',
// Disable renderer process backgrounding
'--disable-renderer-backgrounding',
// Disable task throttling of timer tasks from background pages
'--disable-background-timer-throttling',
'--disable-dev-shm-usage',
'--disable-gpu',
//'--disable-software-rasterizer',
'--mute-audio',
'--remote-debugging-port=0',
'--window-size=1440,900',
].filter(Boolean),
},
Firefox: ['-headless', '--window-size=1440,900'],
},
parallel: process.env.EMBER_EXAM_SPLIT_COUNT || 1,
};