@@ -59,7 +59,16 @@ async function assertReporterOutputEquality(reporter) {
5959async function waitForChildPids ( pid ) {
6060 let childPids = [ ] ;
6161 while ( ! childPids . length ) {
62- childPids = await pidtree ( pid ) ;
62+ try {
63+ childPids = await pidtree ( pid ) ;
64+ } catch ( err ) {
65+ // On Windows, pidtree may fail if wmic is not available (deprecated/removed in newer Windows)
66+ // In this case, we can't reliably get child PIDs, so throw to skip the test
67+ if ( process . platform === 'win32' && err . message && err . message . includes ( 'wmic' ) ) {
68+ throw new Error ( 'pidtree requires wmic on Windows, which is not available' ) ;
69+ }
70+ throw err ;
71+ }
6372 await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) ) ;
6473 }
6574 return childPids ;
@@ -506,7 +515,16 @@ describe("--parallel", function () {
506515 resolveFixturePath ( "options/parallel/test-*" ) ,
507516 "--parallel" ,
508517 ] ) ;
509- const childPids = await waitForChildPids ( pid ) ;
518+ let childPids ;
519+ try {
520+ childPids = await waitForChildPids ( pid ) ;
521+ } catch ( err ) {
522+ if ( err . message && err . message . includes ( 'wmic' ) ) {
523+ this . skip ( ) ;
524+ return ;
525+ }
526+ throw err ;
527+ }
510528 await promise ;
511529 return expect (
512530 Promise . all (
@@ -532,7 +550,16 @@ describe("--parallel", function () {
532550 "--bail" ,
533551 "--parallel" ,
534552 ] ) ;
535- const childPids = await waitForChildPids ( pid ) ;
553+ let childPids ;
554+ try {
555+ childPids = await waitForChildPids ( pid ) ;
556+ } catch ( err ) {
557+ if ( err . message && err . message . includes ( 'wmic' ) ) {
558+ this . skip ( ) ;
559+ return ;
560+ }
561+ throw err ;
562+ }
536563 await promise ;
537564 return expect (
538565 Promise . all (
0 commit comments