Skip to content

Commit

Permalink
Use a timeout of 1s when testing the sandbox on Linux.
Browse files Browse the repository at this point in the history
This is to avoid hanging there forever in case the system is set up
incorrectly.
1s should be plenty to run `/bin/true`.

Fixes bazelbuild#15373.

Closes bazelbuild#15414.

PiperOrigin-RevId: 447701951
  • Loading branch information
meisterT authored and copybara-github committed May 10, 2022
1 parent 79badc0 commit 83ca7d1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ public static boolean isSupported(final CommandEnvironment cmdEnv) throws Interr
private static boolean computeIsSupported(CommandEnvironment cmdEnv, Path linuxSandbox)
throws InterruptedException {
ImmutableList<String> linuxSandboxArgv =
LinuxSandboxUtil.commandLineBuilder(linuxSandbox, ImmutableList.of("/bin/true")).build();
LinuxSandboxUtil.commandLineBuilder(linuxSandbox, ImmutableList.of("/bin/true"))
.setTimeout(Duration.ofSeconds(1))
.build();
ImmutableMap<String, String> env = ImmutableMap.of();
Path execRoot = cmdEnv.getExecRoot();
File cwd = execRoot.getPathFile();
Expand Down

0 comments on commit 83ca7d1

Please sign in to comment.