[lit] Reduce value of synthesized timeouts
authorJulian Lettner <jlettner@apple.com>
Fri, 18 Oct 2019 17:59:46 +0000 (17:59 +0000)
committerJulian Lettner <jlettner@apple.com>
Fri, 18 Oct 2019 17:59:46 +0000 (17:59 +0000)
Large timeout values (one year, positive infinity) trip up Python on
Windows with "OverflowError: timeout value is too large".  One week
seems to work and is still large enough in practice.

Thanks to Simon Pilgrim for helping me test this.
https://reviews.llvm.org/rL375171

llvm-svn: 375264

llvm/utils/lit/lit/run.py

index 29335bd..9cf5713 100644 (file)
@@ -50,8 +50,9 @@ class Run(object):
         self.failure_count = 0
         self.hit_max_failures = False
 
-        one_year = 365 * 24 * 60 * 60  # days * hours * minutes * seconds
-        timeout = self.timeout or one_year
+        # Larger timeouts (one year, positive infinity) don't work on Windows.
+        one_week = 7 * 24 * 60 * 60  # days * hours * minutes * seconds
+        timeout = self.timeout or one_week
 
         start = time.time()
         deadline = start + timeout