#Centipede Do not set command timeout when timeout_per_batch is unset.

PiperOrigin-RevId: 588892340
diff --git a/centipede/centipede_callbacks.cc b/centipede/centipede_callbacks.cc
index 5f4f5f2..e2e86a9 100644
--- a/centipede/centipede_callbacks.cc
+++ b/centipede/centipede_callbacks.cc
@@ -133,7 +133,9 @@
 
   // Allow for the time it takes to fork a subprocess etc.
   const auto amortized_timeout =
-      absl::Seconds(env_.timeout_per_batch) + absl::Seconds(5);
+      env_.timeout_per_batch == 0
+          ? absl::InfiniteDuration()
+          : absl::Seconds(env_.timeout_per_batch) + absl::Seconds(5);
   Command &cmd = commands_.emplace_back(Command(
       /*path=*/binary, /*args=*/{},
       /*env=*/env,