Closed Bug 1653655 Opened 4 years ago Closed 4 years ago

Locally running xpcshell test fails with "TypeError: environment can only contain strings"

Categories

(Testing :: XPCShell Harness, defect)

80 Branch
Unspecified
Windows
defect

Tracking

(firefox-esr68 unaffected, firefox-esr78 unaffected, firefox78 unaffected, firefox79 unaffected, firefox80 fixed)

RESOLVED FIXED
mozilla80
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox78 --- unaffected
firefox79 --- unaffected
firefox80 --- fixed

People

(Reporter: bytesized, Assigned: gbrown)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: dev-prod-2020)

Attachments

(2 files)

When I run this test locally, it fails before the test even starts:

> ./mach test toolkit/mozapps/update/tests/unit_aus_update/ausReadStrings.js
Test configuration changed. Regenerating backend.
 1:21.98 INFO Found node at c:\Users\ksteuber\.mozbuild\node\node.EXE
 1:21.99 INFO Found moz-http2 at c:\mozilla-central\testing\xpcshell\moz-http2\moz-http2.js
Error running mach:

    ['test', 'toolkit/mozapps/update/tests/unit_aus_update/ausReadStrings.js']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file test| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

TypeError: environment can only contain strings

  File "c:\mozilla-central\testing/mach_commands.py", line 383, in test
    argv=extra_args, test_objects=tests, **kwargs)
  File "c:\mozilla-central\python/mach\mach\registrar.py", line 152, in dispatch
    return self._run_command_handler(handler, context=context, **kwargs)
  File "c:\mozilla-central\python/mach\mach\registrar.py", line 109, in _run_command_handler
    result = fn(**kwargs)
  File "c:\mozilla-central\testing/xpcshell/mach_commands.py", line 262, in run_xpcshell_test
    return xpcshell.run_test(**params)
  File "c:\mozilla-central\testing/xpcshell/mach_commands.py", line 62, in run_test
    return self.run_suite(**kwargs)
  File "c:\mozilla-central\testing/xpcshell/mach_commands.py", line 48, in run_suite
    return self._run_xpcshell_harness(**kwargs)
  File "c:\mozilla-central\testing/xpcshell/mach_commands.py", line 135, in _run_xpcshell_harness
    result = xpcshell.runTests(kwargs)
  File "c:\mozilla-central\testing/xpcshell\runxpcshelltests.py", line 1542, in runTests
    self.trySetupNode()
  File "c:\mozilla-central\testing/xpcshell\runxpcshelltests.py", line 1261, in trySetupNode
    startServer('moz-http2', os.path.join(myDir, 'moz-http2', 'moz-http2.js'))
  File "c:\mozilla-central\testing/xpcshell\runxpcshelltests.py", line 1243, in startServer
    universal_newlines=True)
  File "c:\mozilla-central\third_party/python/sentry-sdk\sentry_sdk\integrations\stdlib.py", line 190, in sentry_patched_popen_init
    rv = old_popen_init(self, *a, **kw)  # type: ignore
  File "c:\mozilla-build\python\lib\subprocess.py", line 394, in __init__
    errread, errwrite)
  File "c:\mozilla-build\python\lib\subprocess.py", line 644, in _execute_child
    startupinfo)
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-Break to quit

I wrote a patch (attached) that seems to get things working for me locally, but I don't have much faith in its "correctness", so I'm posting it more to be informative and maybe help others that are experiencing this problem. I would rather someone that understands this code better write the patch that gets merged.

I'm running Windows 10. My tree is at commit 840f99340069.

Component: General → XPCShell Harness
Regressed by: 1639009
Summary: Locally running test fails with "TypeError: environment can only contain strings" → Locally running xpcshell test fails with "TypeError: environment can only contain strings"
Whiteboard: dev-prod-2020

Copy ensure_subprocess_env from mozbuild.util (not currently accessible from the
automation mozharness environment) to xpcshell harness, and use it.

Assignee: nobody → gbrown
Status: NEW → ASSIGNED
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2850b7d7ae65
Use ensure_subprocess_env in xpcshell tests; r=jmaher
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80

Set release status flags based on info from the regressing bug 1639009

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: