Skip to content

Commit 83ca7d1

Browse files
meisterTcopybara-github
authored andcommitted
Use a timeout of 1s when testing the sandbox on Linux.
This is to avoid hanging there forever in case the system is set up incorrectly. 1s should be plenty to run `/bin/true`. Fixes #15373. Closes #15414. PiperOrigin-RevId: 447701951
1 parent 79badc0 commit 83ca7d1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ public static boolean isSupported(final CommandEnvironment cmdEnv) throws Interr
8888
private static boolean computeIsSupported(CommandEnvironment cmdEnv, Path linuxSandbox)
8989
throws InterruptedException {
9090
ImmutableList<String> linuxSandboxArgv =
91-
LinuxSandboxUtil.commandLineBuilder(linuxSandbox, ImmutableList.of("/bin/true")).build();
91+
LinuxSandboxUtil.commandLineBuilder(linuxSandbox, ImmutableList.of("/bin/true"))
92+
.setTimeout(Duration.ofSeconds(1))
93+
.build();
9294
ImmutableMap<String, String> env = ImmutableMap.of();
9395
Path execRoot = cmdEnv.getExecRoot();
9496
File cwd = execRoot.getPathFile();

0 commit comments

Comments
 (0)