Skip to content

Commit 95fe13f

Browse files
committed
loadingtests: add default timeout
loadingtests didn't provide a way to set a timeout, which means they trip --test_verbose_timeout_warnings; this provides a basic way to do so, and sets a default timeout of short since normal loadingtests would have a hard time successfully being any larger.
1 parent 454b259 commit 95fe13f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/unittest.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,14 +640,15 @@ def _loading_make(name):
640640
)
641641
return struct(name = name)
642642

643-
def _loading_assert_equals(env, test_case, expected, actual):
643+
def _loading_assert_equals(env, test_case, expected, actual, timeout = "short"):
644644
"""Creates a test case for asserting state at LOADING phase.
645645
646646
Args:
647647
env: Loading test env created from loadingtest.make
648648
test_case: Name of the test case
649649
expected: Expected value to test
650650
actual: Actual value received.
651+
timeout: Test timeout passed into the generated rule.
651652
652653
Returns:
653654
None, creates test case
@@ -661,6 +662,7 @@ def _loading_assert_equals(env, test_case, expected, actual):
661662
name = "%s_%s" % (env.name, test_case),
662663
failure_message = msg,
663664
tags = [env.name + "_test_case"],
665+
timeout = timeout,
664666
)
665667

666668
asserts = struct(

0 commit comments

Comments
 (0)