Skip to content

Commit

Permalink
Merge branch 'ershi/test-timeout-fix' into 'main'
Browse files Browse the repository at this point in the history
Add an example-specific test timeout option

See merge request omniverse/warp!621
  • Loading branch information
shi-eric committed Jul 13, 2024
2 parents 07568a5 + 0c8c489 commit 943561d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions warp/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,12 @@ def run(test, device):

command.extend(_build_command_line_options(options))

# Set the test timeout in seconds
test_timeout = options.pop("test_timeout", 300)

# with wp.ScopedTimer(f"{name}_{sanitize_identifier(device)}"):
# Run the script as a subprocess
result = subprocess.run(command, capture_output=True, text=True, env=env_vars, timeout=300)
result = subprocess.run(command, capture_output=True, text=True, env=env_vars, timeout=test_timeout)

# Check the return code (0 is standard for success)
test.assertEqual(
Expand Down Expand Up @@ -223,6 +226,7 @@ class TestCoreExamples(unittest.TestCase):
name="core.example_torch",
devices=test_devices,
test_options={"headless": True, "num_frames": 1000, "torch_required": True},
test_options_cpu={"test_timeout": 600},
)
add_example_test(TestCoreExamples, name="core.example_wave", devices=test_devices)

Expand All @@ -232,7 +236,11 @@ class TestOptimExamples(unittest.TestCase):


add_example_test(
TestOptimExamples, name="optim.example_bounce", devices=test_devices, test_options_cpu={"train_iters": 3}
TestOptimExamples,
name="optim.example_bounce",
devices=test_devices,
test_options_cpu={"train_iters": 3},
test_options_cuda={"test_timeout": 600},
)
add_example_test(
TestOptimExamples,
Expand Down Expand Up @@ -283,7 +291,9 @@ class TestSimExamples(unittest.TestCase):
pass


add_example_test(TestSimExamples, name="sim.example_cartpole", devices=test_devices)
add_example_test(
TestSimExamples, name="sim.example_cartpole", devices=test_devices, test_options_cuda={"test_timeout": 600}
)
add_example_test(
TestSimExamples,
name="sim.example_cloth",
Expand Down

0 comments on commit 943561d

Please sign in to comment.