Skip to content

Commit d22a8dd

Browse files
committed
Fix handling timeouts in test tagger
1 parent c1ac9c4 commit d22a8dd

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_tagged_unittests.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@
3737
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3838
# SOFTWARE.
3939

40-
import sys
41-
4240
import glob
43-
import test
44-
4541
import os
4642
import subprocess
43+
import sys
44+
import test
4745

4846
if os.environ.get("ENABLE_CPYTHON_TAGGED_UNITTESTS") == "true" or __name__ == "__main__":
4947
TAGS_DIR = os.path.join(os.path.dirname(__file__), "unittest_tags")
@@ -225,6 +223,10 @@ def main():
225223
print("*stderr*")
226224
print(p.stderr)
227225

226+
if p.returncode == -9:
227+
print(
228+
f"\nTimeout (return code -9)\nyou can try to increase the current timeout {tout}s by using --timeout=NNN")
229+
228230
passing_tests = set()
229231
failing_tests = set()
230232

@@ -245,7 +247,7 @@ def main():
245247
f.write("\n")
246248
if not passing_tests:
247249
os.unlink(tagfile)
248-
print("No successful tests detected (you can try to increase the timeout by using --timeout=NNN)")
250+
print("No successful tests detected")
249251
break
250252

251253
if p.returncode == 0:
@@ -254,10 +256,6 @@ def main():
254256
continue
255257
print(f"Suite succeeded with {len(passing_tests)} tests")
256258
break
257-
elif p.returncode == -9:
258-
print(
259-
f"\nTimeout (return code -9)\nyou can try to increase the current timeout {tout}s by using --timeout=NNN")
260-
break
261259
else:
262260
print(f"Suite failed, retrying with {len(passing_tests)} tests")
263261

0 commit comments

Comments
 (0)