Closed Bug 1041546 Opened 5 years ago Closed 5 years ago

TypeError: cannot concatenate 'str' and 'int' objects in tbplformatter.py when running certain browser-chrome directory

Categories

(Testing :: Mozbase, defect)

x86
macOS
defect
Not set

Tracking

(firefox33 fixed, firefox34 fixed)

RESOLVED FIXED
mozilla34
Tracking Status
firefox33 --- fixed
firefox34 --- fixed

People

(Reporter: martijn.martijn, Assigned: jgraham)

References

Details

(Keywords: regression)

Attachments

(1 file)

When I run ./mach mochitest-browser browser/components/places/tests/browser/
I get this error:
735 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js | Number of dragged items should be the same. - Number of dragged items should be the same.
736 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js | Number of flavors for item 0 should be the same. - Number of flavors for item 0 should be the same.
737 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js | Flavor text/x-moz-place for item 0 should be the same. - Flavor text/x-moz-place for item 0 should be the same.
738 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js | Contents for item 0 with flavor text/x-moz-place should be the same. - Contents for item 0 with flavor text/x-moz-place should be the same.
739 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js | Flavor text/x-moz-url for item 0 should be the same. - Flavor text/x-moz-url for item 0 should be the same.
740 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js | Contents for item 0 with flavor text/x-moz-url should be the same. - Contents for item 0 with flavor text/x-moz-url should be the same.
741 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js | Flavor text/plain for item 0 should be the same. - Flavor text/plain for item 0 should be the same.
742 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js | Contents for item 0 with flavor text/plain should be the same. - Contents for item 0 with flavor text/plain should be the same.
743 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js | Flavor text/html for item 0 should be the same. - Flavor text/html for item 0 should be the same.
744 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js | Contents for item 0 with flavor text/html should be the same. - Contents for item 0 with flavor text/html should be the same.
745 INFO --DOMWINDOW == 69 (0x13a5bb210) [pid = 71902] [serial = 52] [outer = 0x1156e3600] [url = about:blank]
746 INFO --DOMWINDOW == 68 (0x13c6647a0) [pid = 71902] [serial = 46] [outer = 0x1156e3600] [url = about:blank]
747 INFO --DOMWINDOW == 67 (0x13aee2f30) [pid = 71902] [serial = 43] [outer = 0x13aed35a0] [url = about:blank]
748 INFO --DOMWINDOW == 66 (0x12241ae80) [pid = 71902] [serial = 8] [outer = 0x1222cd180] [url = about:blank]
749 INFO MEMORY STAT vsize after test: 3693383680
750 INFO MEMORY STAT residentFast after test: 432852992
751 INFO TEST-OK | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js | took 415ms
752 INFO ++DOCSHELL 0x13427fc00 == 12 [pid = 71902] [id = 28]
753 INFO ++DOMWINDOW == 67 (0x13acf3150) [pid = 71902] [serial = 71] [outer = 0x0]
754 INFO ++DOMWINDOW == 68 (0x10a9e1a90) [pid = 71902] [serial = 72] [outer = 0x13acf3150]
755 INFO [71902] WARNING: NS_ENSURE_TRUE(mMutable) failed: file /Users/mwargers/mozilla-central/netwerk/base/src/nsSimpleURI.cpp, line 265
756 INFO checking window state
757 INFO TEST-START | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_history_sidebar_search.js
758 INFO ++DOMWINDOW == 69 (0x13c880e50) [pid = 71902] [serial = 73] [outer = 0x1156e3600]
759 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_history_sidebar_search.js | There should be only 1 column in the sidebar - There should be only 1 column in the sidebar
760 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_history_sidebar_search.js | Node is in correct position based on its visit date - Node is in correct position based on its visit date
761 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_history_sidebar_search.js | Node is in correct position based on its visit date - Node is in correct position based on its visit date
762 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_history_sidebar_search.js | Node is in correct position based on its visit date - Node is in correct position based on its visit date
763 INFO TEST-PASS | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_history_sidebar_search.js | Node is in correct position based on its visit date - Node is in correct position based on its visit date
Exception in thread Thread-12:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 808, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 761, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/mwargers/mozilla-central/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 774, in _processOutput
    self.processOutputLine(line.rstrip())
  File "/Users/mwargers/mozilla-central/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 719, in processOutputLine
    handler(line)
  File "/Users/mwargers/mozilla-central/obj-x86_64-apple-darwin13.3.0/_tests/testing/mochitest/runtests.py", line 1802, in processOutputLine
    self.harness.message_logger.process_message(message)
  File "/Users/mwargers/mozilla-central/obj-x86_64-apple-darwin13.3.0/_tests/testing/mochitest/runtests.py", line 138, in process_message
    self.logger.log_raw(message)
  File "/Users/mwargers/mozilla-central/testing/mozbase/mozlog/mozlog/structured/structuredlog.py", line 120, in log_raw
    self._handle_log(data)
  File "/Users/mwargers/mozilla-central/testing/mozbase/mozlog/mozlog/structured/structuredlog.py", line 132, in _handle_log
    handler(data)
  File "/Users/mwargers/mozilla-central/testing/mozbase/mozlog/mozlog/structured/handlers/__init__.py", line 60, in __call__
    formatted = self.formatter(data)
  File "/Users/mwargers/mozilla-central/obj-x86_64-apple-darwin13.3.0/_tests/testing/mochitest/runtests.py", line 72, in __call__
    tbpl_output = super(MochitestFormatter, self).__call__(data)
  File "/Users/mwargers/mozilla-central/testing/mozbase/mozlog/mozlog/structured/formatters/tbplformatter.py", line 17, in __call__
    return getattr(self, data["action"])(data)
  File "/Users/mwargers/mozilla-central/testing/mozbase/mozlog/mozlog/structured/formatters/tbplformatter.py", line 38, in test_status
    message = "- " + data["message"] if "message" in data else ""
TypeError: cannot concatenate 'str' and 'int' objects
Same thing for browser/components/tabview/.
Just hit the same for "./mach mochitest-plain layout/style/test/"
Fixing this by doing

message = "- " + str(data["message"]) if "message" in data else ""

is quite easy and wfm locally. Not sure if that's the desired fix here?
Blocks: 1030845
Flags: needinfo?(cmanchester)
Keywords: regression
That's a reasonable fix for this specific case, but I think message should be coerced to string in the logger, otherwise we will have the same problem with other consumers.
The attached patch should fix things on the producer side. It would be useful for someone who has experienced this problem to verify the patch fixes it.
Comment on attachment 8460179 [details] [diff] [review]
Ensure that structured log message fields are always strings.

Review of attachment 8460179 [details] [diff] [review]:
-----------------------------------------------------------------

I think this is the right fix. I reproduced locally running layout tests, and this takes care of it.
Attachment #8460179 - Flags: review?(cmanchester) → review+
Flags: needinfo?(cmanchester)
Also, why didn't this break the tests on tbpl?
(In reply to David Baron [:dbaron] (UTC-7) (needinfo? for questions) from comment #9)
> Also, why didn't this break the tests on tbpl?

The problem was in formatting test_status messages, which are not logged unless a test fails or requests full logging.
There are plenty of intermittent failures on TBPL per day, and they didn't all end in python exceptions.
But most messages are strings, not integers. This failure required the combination of both a) a test failure and b) the associated message for that failure being an integer.
https://hg.mozilla.org/mozilla-central/rev/943221c86898
Assignee: nobody → james
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.