Skip to content

Commit 861cc18

Browse files
vmoroztargos
authored andcommitted
test: fix debug test crashes caused by sea tests
PR-URL: #60807 Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 14aae19 commit 861cc18

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

test/sea/testcfg.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55
def GetConfiguration(context, root):
66
# We don't use arch-specific out folder in Node.js; use none/none to auto
77
# detect release mode from GetVm and get the path to the executable.
8-
vm = context.GetVm('none', 'none')
8+
try:
9+
vm = context.GetVm('none', 'none')
10+
except ValueError:
11+
# In debug only builds, we are getting an exception because none/none
12+
# results in taking the release flavor that is missing in that case. Try to
13+
# recover by using the first mode passed explicitly to the test.py.
14+
preferred_mode = getattr(context, 'default_mode', 'none') or 'none'
15+
vm = context.GetVm('none', preferred_mode)
16+
917
if not os.path.isfile(vm):
1018
return testpy.SimpleTestConfiguration(context, root, 'sea')
1119

tools/test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,14 @@ def Main():
16971697
options.store_unexpected_output,
16981698
options.repeat,
16991699
options.abort_on_timeout)
1700+
# Remember the primary mode requested on the CLI so suites can reuse it when
1701+
# they need to probe for a binary outside of the normal test runner flow.
1702+
for requested_mode in options.mode:
1703+
if requested_mode:
1704+
context.default_mode = requested_mode
1705+
break
1706+
else:
1707+
context.default_mode = 'none'
17001708

17011709
if options.error_reporter:
17021710
context.use_error_reporter = True

0 commit comments

Comments
 (0)