Closed Bug 1470397 Opened 6 years ago Closed 6 years ago

TypeError: __getnewargs__ should return a tuple, not 'unicode' on "./mach test testing/firefox-ui/tests/puppeteer/test_places.py"

Categories

(Testing :: Firefox UI Tests, defect)

defect
Not set
normal

Tracking

(firefox-esr52 unaffected, firefox-esr60 unaffected, firefox61 wontfix, firefox62 wontfix, firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- unaffected
firefox61 --- wontfix
firefox62 --- wontfix
firefox63 --- fixed

People

(Reporter: ato, Assigned: ahal)

References

Details

(Keywords: regression)

Attachments

(1 file)

It is currently not possible to use "./mach test TEST" with the
Firefox UI tests.  "./mach firefox-ui-tests TEST" works as expected.

> % MOZ_HEADLESS=1 ./mach test testing/firefox-ui/tests/puppeteer/test_places.py
>  0:00.00 ERROR Failure during harness execution
> Traceback (most recent call last):
> 
>   File "/home/ato/src/gecko/testing/marionette/harness/marionette_harness/runtests.py", line 94, in cli
>     failed = harness_instance.run()
> 
>   File "/home/ato/src/gecko/testing/marionette/harness/marionette_harness/runtests.py", line 72, in run
>     runner = self._runner_class(**self.args)
> 
>   File "/home/ato/src/gecko/testing/firefox-ui/harness/firefox_ui_harness/runners/base.py", line 18, in __init__
>     super(FirefoxUITestRunner, self).__init__(**kwargs)
> 
>   File "/home/ato/src/gecko/testing/marionette/harness/marionette_harness/runner/base.py", line 532, in __init__
>     self.test_kwargs = deepcopy(kwargs)
> 
>   File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
>     y = copier(x, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
>     y[deepcopy(key, memo)] = deepcopy(value, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
>     y = _reconstruct(x, rv, 1, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
>     state = deepcopy(state, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
>     y = copier(x, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
>     y[deepcopy(key, memo)] = deepcopy(value, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
>     y = _reconstruct(x, rv, 1, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
>     state = deepcopy(state, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
>     y = copier(x, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
>     y[deepcopy(key, memo)] = deepcopy(value, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
>     y = copier(x, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 230, in _deepcopy_list
>     y.append(deepcopy(a, memo))
> 
>   File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
>     y = _reconstruct(x, rv, 1, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
>     state = deepcopy(state, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
>     y = copier(x, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
>     y[deepcopy(key, memo)] = deepcopy(value, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
>     y = copier(x, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 230, in _deepcopy_list
>     y.append(deepcopy(a, memo))
> 
>   File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
>     y = _reconstruct(x, rv, 1, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
>     state = deepcopy(state, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
>     y = copier(x, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
>     y[deepcopy(key, memo)] = deepcopy(value, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 190, in deepcopy
>     y = _reconstruct(x, rv, 1, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct
>     state = deepcopy(state, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
>     y = copier(x, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
>     y[deepcopy(key, memo)] = deepcopy(value, memo)
> 
>   File "/usr/lib/python2.7/copy.py", line 182, in deepcopy
>     rv = reductor(2)
> 
> TypeError: __getnewargs__ should return a tuple, not 'unicode'

And with "./mach firefox-ui-tests" it works as expected:

> % MOZ_HEADLESS=1 ./mach firefox-ui-functional testing/firefox-ui/tests/puppeteer/test_places.py
>  0:00.00 INFO Using workspace for temporary data: "/home/ato/src/gecko"
>  0:00.00 INFO Application command: /home/ato/src/gecko/obj-x86_64-pc-linux-gnu/dist/bin/firefox -no-remote -marionette -profile /tmp/tmpJEWii0.mozrunner
>  0:01.82 INFO Profile path is /tmp/tmpJEWii0.mozrunner
>  0:01.82 INFO Starting fixture servers
>  0:01.92 INFO Fixture server listening on http://127.0.0.1:38211/
>  0:01.92 INFO Fixture server listening on https://127.0.0.1:40851/
>  0:01.95 INFO e10s is enabled
>  0:01.96 mozversion INFO application_buildid: 20180608180906
>  0:01.96 mozversion INFO application_display_name: Nightly
>  0:01.96 mozversion INFO application_id: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
>  0:01.96 mozversion INFO application_name: Firefox
>  0:01.96 mozversion INFO application_remotingname: firefox
>  0:01.96 mozversion INFO application_vendor: Mozilla
>  0:01.96 mozversion INFO application_version: 62.0a1
>  0:01.96 mozversion INFO platform_buildid: 20180608180906
>  0:01.96 mozversion INFO platform_version: 62.0a1
>  0:01.96 SUITE_START: marionette-test - running 1 tests
>  0:01.96 TEST_START: testing/firefox-ui/tests/puppeteer/test_places.py TestPlaces.test_bookmarks
>  0:03.09 TEST_END: PASS
>  0:03.09 TEST_START: testing/firefox-ui/tests/puppeteer/test_places.py TestPlaces.test_history
>  0:07.71 TEST_END: PASS
>  0:07.71 TEST_START: testing/firefox-ui/tests/puppeteer/test_places.py TestPlaces.test_plugins
>  0:08.05 TEST_END: PASS
>  0:08.05 INFO 
> SUMMARY
> -------
>  0:08.05 INFO passed: 3
>  0:08.05 INFO failed: 0
>  0:08.05 INFO todo: 0
>  0:08.05 SUITE_END
> 
> marionette-test
> ~~~~~~~~~~~~~~~
> Ran 3 checks (3 tests)
> Expected results: 3
> OK
The problem here is the instance of structuredLogger which is being added to kwargs by the global `mach test` command:

> {
>   'package_name': None,
>   'log_mach_level': None,
>   'test_objects': [
>     {
>       'name': 'test_places.py',
>       'tags': 'local',
>       'here': u'/Volumes/data/code/gecko/testing/firefox-ui/tests/puppeteer',
>       'manifest': u'/Volumes/data/code/gecko/testing/firefox-ui/tests/puppeteer/manifest.ini',
>       u'file_relpath': u'testing/firefox-ui/tests/puppeteer/test_places.py',
>       'path': u'/Volumes/data/code/gecko/testing/firefox-ui/tests/puppeteer/test_places.py',
>       u'flavor': u'firefox-ui-functional',
>       u'dir_relpath': u'testing/firefox-ui/tests/puppeteer',
>       'relpath': u'testing/firefox-ui/tests/puppeteer/test_places.py'
>     }
>   ],
>   'emulator_bin': None,
>   'avd': None,
>   'prefs_files': None,
>   'jsdebugger': False,
>   'log_errorsummary': None,
>   'log_xunit': None,
>   'log_mach': None,
>   'log_tbpl_level': None,
>   'log': <mozlog.structuredlog.StructuredLoggerobjectat0x117959390>,
>   'log_tbpl': None,
>   'log_unittest': None,
>   'avd_home': None,
>   'pydebugger': None,
>   'log_tbpl_compact': None,
>   'log_tbpl_buffer': None,
>   'log_raw': None,
>   'logger_name': 'Marionette-based Tests',
>   'log_mach_buffer': None,
>   'log_mach_verbose': None,
>   'log_raw_level': None,
>   'adb_path': None,
>   'prefs_args': None,
>   'log_html': None,
>   'device_serial': None
> }

Removing that from kwargs before calling `deepcopy` it works all fine.
This is a regression from bug 1443557 and might need a similar fix as bug 1432683. Andrew, can you please have a look?
Flags: needinfo?(ahal)
Assignee: nobody → ahal
Status: NEW → ASSIGNED
Flags: needinfo?(ahal)
Comment on attachment 8988186 [details]
Bug 1470397 - Use logger from created from |mach test| in testing/firefox-ui/mach_commands.py, r?whimboo

Henrik Skupin (:whimboo) has approved the revision.

https://phabricator.services.mozilla.com/D1844
Attachment #8988186 - Flags: review+
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/16cad8d7cb82
Use logger from created from |mach test| in testing/firefox-ui/mach_commands.py, r=whimboo
https://hg.mozilla.org/mozilla-central/rev/16cad8d7cb82
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Is this something we should backport to 62?
Not that important, but if the patch applies cleanly feel free to uplift. Thanks.
Flags: needinfo?(ahal)
Fwiw, I don't think this was technically a regression as back when this error got introduced |mach test| wasn't able to run harnesses like this anyway (though I could be wrong).
(In reply to Andrew Halberstadt [:ahal] from comment #9)
> Fwiw, I don't think this was technically a regression as back when this
> error got introduced |mach test| wasn't able to run harnesses like this
> anyway (though I could be wrong).

Mach was able to run firefox-ui tests for a very long time. Your patch as mentioned earlier in this bug really regressed it.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: