Skip to content

Commit 4243880

Browse files
authored
tests - increase timeout when running in CI (microsoft#182288)
1 parent 363a88d commit 4243880

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

test/unit/browser/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,13 @@ async function runTestsInBrowser(testModules, browserType) {
131131
const page = await context.newPage();
132132
const target = url.pathToFileURL(path.join(__dirname, 'renderer.html'));
133133
if (argv.build) {
134-
target.search = `?build=true`;
134+
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
135+
target.search = `?build=true&ci=true`;
136+
} else {
137+
target.search = `?build=true`;
138+
}
139+
} else if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
140+
target.search = `?ci=true`;
135141
}
136142

137143
const emitter = new events.EventEmitter();

test/unit/browser/renderer.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@
3131
}
3232
});
3333

34+
const urlParams = new URLSearchParams(window.location.search);
35+
const isCI = urlParams.get('ci');
36+
3437
mocha.setup({
3538
ui: 'tdd',
36-
timeout: 5000
39+
timeout: isCI ? 30000 : 5000
3740
});
3841
</script>
3942

@@ -42,7 +45,6 @@
4245
<script src="../../../out-build/vs/loader.js"></script>
4346

4447
<script>
45-
const urlParams = new URLSearchParams(window.location.search);
4648
const isBuild = urlParams.get('build');
4749

4850
// configure loader

test/unit/electron/renderer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
mocha.setup({
3737
ui: 'tdd',
38-
timeout: 5000,
38+
timeout: typeof process.env['BUILD_ARTIFACTSTAGINGDIRECTORY'] === 'string' ? 30000 : 5000,
3939
forbidOnly: typeof process.env['BUILD_ARTIFACTSTAGINGDIRECTORY'] === 'string' // disallow .only() when running on build machine
4040
});
4141
require('./renderer');

0 commit comments

Comments
 (0)