mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test: fix debug test crashes caused by sea tests
PR-URL: https://github.com/nodejs/node/pull/60807 Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
@@ -5,7 +5,15 @@ import testpy
|
||||
def GetConfiguration(context, root):
|
||||
# We don't use arch-specific out folder in Node.js; use none/none to auto
|
||||
# detect release mode from GetVm and get the path to the executable.
|
||||
vm = context.GetVm('none', 'none')
|
||||
try:
|
||||
vm = context.GetVm('none', 'none')
|
||||
except ValueError:
|
||||
# In debug only builds, we are getting an exception because none/none
|
||||
# results in taking the release flavor that is missing in that case. Try to
|
||||
# recover by using the first mode passed explicitly to the test.py.
|
||||
preferred_mode = getattr(context, 'default_mode', 'none') or 'none'
|
||||
vm = context.GetVm('none', preferred_mode)
|
||||
|
||||
if not os.path.isfile(vm):
|
||||
return testpy.SimpleTestConfiguration(context, root, 'sea')
|
||||
|
||||
|
||||
@@ -1697,6 +1697,14 @@ def Main():
|
||||
options.store_unexpected_output,
|
||||
options.repeat,
|
||||
options.abort_on_timeout)
|
||||
# Remember the primary mode requested on the CLI so suites can reuse it when
|
||||
# they need to probe for a binary outside of the normal test runner flow.
|
||||
for requested_mode in options.mode:
|
||||
if requested_mode:
|
||||
context.default_mode = requested_mode
|
||||
break
|
||||
else:
|
||||
context.default_mode = 'none'
|
||||
|
||||
if options.error_reporter:
|
||||
context.use_error_reporter = True
|
||||
|
||||
Reference in New Issue
Block a user