@@ -104,6 +104,8 @@ const nvidiaMissingDeviceDriverFailure =
104104const arbitraryComposeFailure =
105105 "Error response from daemon: network sandbox setup failed"
106106
107+ const gpuAllComposeYamlPattern = / ( ^ | \s ) g p u s : \s * [ " ' ] ? a l l [ " ' ] ? ( \s | $ ) / m
108+
107109const nvidiaFailureMarkers : ReadonlyArray < string > = [
108110 nvidiaContainerCliMarker ,
109111 libNvidiaMlMarker ,
@@ -318,7 +320,7 @@ describe("runDockerComposeUpWithPortCheck", () => {
318320 expect ( started . gpu ) . toBe ( "none" )
319321
320322 const composeAfter = yield * _ ( fs . readFileString ( path . join ( outDir , "docker-compose.yml" ) ) )
321- expect ( composeAfter ) . not . toMatch ( / \b g p u s : \s * a l l \b / )
323+ expect ( composeAfter ) . not . toMatch ( gpuAllComposeYamlPattern )
322324
323325 const configAfter = yield * _ ( fs . readFileString ( path . join ( outDir , "docker-git.json" ) ) )
324326 expect ( configAfter ) . toContain ( '"gpu": "none"' )
@@ -366,7 +368,7 @@ describe("runDockerComposeUpWithPortCheck", () => {
366368 expect ( started . gpu ) . toBe ( "none" )
367369
368370 const composeAfter = yield * _ ( fs . readFileString ( path . join ( outDir , "docker-compose.yml" ) ) )
369- expect ( composeAfter ) . not . toMatch ( / \b g p u s : \s * a l l \b / )
371+ expect ( composeAfter ) . not . toMatch ( gpuAllComposeYamlPattern )
370372
371373 const configAfter = yield * _ ( fs . readFileString ( path . join ( outDir , "docker-git.json" ) ) )
372374 expect ( configAfter ) . toContain ( '"gpu": "none"' )
@@ -442,7 +444,7 @@ describe("runDockerComposeUpWithPortCheck", () => {
442444 expect ( started . gpu ) . toBe ( "none" )
443445
444446 const composeAfter = yield * _ ( fs . readFileString ( path . join ( outDir , "docker-compose.yml" ) ) )
445- expect ( composeAfter ) . not . toMatch ( / \b g p u s : \s * a l l \b / )
447+ expect ( composeAfter ) . not . toMatch ( gpuAllComposeYamlPattern )
446448
447449 const configAfter = yield * _ ( fs . readFileString ( path . join ( outDir , "docker-git.json" ) ) )
448450 expect ( configAfter ) . toContain ( '"gpu": "none"' )
0 commit comments