diff --git a/test/sea/testcfg.py b/test/sea/testcfg.py index 3eb661072bc011..8f3acefe4ecedf 100644 --- a/test/sea/testcfg.py +++ b/test/sea/testcfg.py @@ -5,7 +5,15 @@ 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') diff --git a/tools/test.py b/tools/test.py index 645385b0a8798f..500c6a85f5a646 100755 --- a/tools/test.py +++ b/tools/test.py @@ -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