Skip to content

Commit 244f17c

Browse files
committed
sim tests
1 parent acedc5a commit 244f17c

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

src/software/simulated_tests/simulated_test_fixture.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323

2424
logger = create_logger(__name__)
2525

26-
LAUNCH_DELAY_S = 2
27-
WORLD_BUFFER_TIMEOUT = 10
26+
LAUNCH_DELAY_S = 0.1
27+
WORLD_BUFFER_TIMEOUT = 0.5
2828
PROCESS_BUFFER_DELAY_S = 0.1
29-
PAUSE_AFTER_FAIL_DELAY_S = 5
29+
PAUSE_AFTER_FAIL_DELAY_S = 3
3030
SECONDS_PER_MILLISECOND = 0.001
3131

3232

@@ -122,7 +122,7 @@ def runner(
122122
eventually_validation_sequence_set,
123123
test_timeout_s=3,
124124
tick_duration_s=1.0 / 60.0,
125-
ci_cmd_with_delay=[],
125+
ci_cmd_with_delay=None,
126126
run_till_end=False,
127127
**kwargs,
128128
):
@@ -136,6 +136,7 @@ def runner(
136136
:param ci_cmd_with_delay: A list consisting of tuples with a duration and CI command, e.g.
137137
[(1.0, Command.Type.NORMAL_START, Team.BLUE)]
138138
"""
139+
ci_cmd_with_delay = list(ci_cmd_with_delay) if ci_cmd_with_delay else []
139140
time_elapsed_s = 0
140141
eventually_validation_failure_msg = "Test Timed Out"
141142
eventually_validation_proto_set = None
@@ -249,12 +250,12 @@ def runner(
249250
@override
250251
def run_test(
251252
self,
252-
always_validation_sequence_set=[[]],
253-
eventually_validation_sequence_set=[[]],
253+
always_validation_sequence_set=None,
254+
eventually_validation_sequence_set=None,
254255
setup=None,
255256
test_timeout_s=3,
256257
tick_duration_s=1.0 / 60.0,
257-
ci_cmd_with_delay=[],
258+
ci_cmd_with_delay=None,
258259
run_till_end=False,
259260
**kwargs,
260261
):
@@ -265,6 +266,8 @@ def run_test(
265266
:param setup: initialization function for this test
266267
:param test_timeout_s: how long the test will run
267268
"""
269+
always_validation_sequence_set = always_validation_sequence_set or [[]]
270+
eventually_validation_sequence_set = eventually_validation_sequence_set or [[]]
268271
# Set the hook for exception handling so that we can close the thunderscope
269272
# instance should one exist
270273
sys.excepthook = self.excepthook
@@ -298,9 +301,9 @@ def __init__(self, *args, **kwargs):
298301
def run_test(
299302
self,
300303
setup=(lambda arg: None),
301-
params=[],
302-
ag_always_validation_sequence_set=[[]],
303-
ag_eventually_validation_sequence_set=[[]],
304+
params=None,
305+
ag_always_validation_sequence_set=None,
306+
ag_eventually_validation_sequence_set=None,
304307
**kwargs,
305308
):
306309
"""Begins validating a test based on incoming world protos. Runs the
@@ -311,6 +314,9 @@ def run_test(
311314
:param ag_eventually_validation_sequence_set: validation set for aggregate test that must eventually be true
312315
:param ag_always_validation_sequence_set: validation set for aggregate test that must always be true
313316
"""
317+
params = params or []
318+
ag_always_validation_sequence_set = ag_always_validation_sequence_set or [[]]
319+
ag_eventually_validation_sequence_set = ag_eventually_validation_sequence_set or [[]]
314320
sys.excepthook = self.excepthook
315321

316322
failed_tests = 0

0 commit comments

Comments
 (0)