test: fix visibility-state-spec.ts flaky test (#44199)

* test: refactor visibility-state-spec

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* ci: shard tests

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* test: update split-tests for use on Windows

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* test: run visibility-state-spec.ts first

Co-Authored-By: John Kleinschmidt <jkleinsc@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
trop[bot] 2024-10-14 09:39:19 -04:00 committed by GitHub
parent 7887395e92
commit f269ca1d93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 76 additions and 56 deletions

View file

@ -1,6 +1,7 @@
const glob = require('glob');
const fs = require('node:fs');
const path = require('node:path');
const currentShard = parseInt(process.argv[2], 10);
const shardCount = parseInt(process.argv[3], 10);
@ -25,7 +26,7 @@ specFiles.sort((a, b) => {
let shard = 0;
for (const specFile of specFiles) {
buckets[shard].push(specFile);
buckets[shard].push(path.normalize(specFile));
shard++;
if (shard === shardCount) shard = 0;
}