Intermittent /webdriver/tests/bidi/log_entry_added/event_buffer.py | test_console_log_cached_messages[javascript_error] - assert 4 == 3
Categories
(Remote Protocol :: WebDriver BiDi, defect, P2)
Tracking
(firefox-esr91 unaffected, firefox95 unaffected, firefox96 unaffected, firefox97 fixed)
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | unaffected |
firefox95 | --- | unaffected |
firefox96 | --- | unaffected |
firefox97 | --- | fixed |
People
(Reporter: intermittent-bug-filer, Assigned: jdescottes)
References
(Regression)
Details
(Keywords: intermittent-failure, regression, Whiteboard: [bidi-m2-mvp])
Attachments
(1 file)
Filed by: jdescottes [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=360518706&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FVgepd3gQuiAWqOfty4tvQ/runs/0/artifacts/public/logs/live_backing.log
Assignee | ||
Comment 1•2 years ago
|
||
The test seems to fail for javascript errors (not console api messages), at the last step of test_console_log_cached_messages
.
The events array looks like:
[task 2021-12-08T10:36:57.232Z] 10:36:57 INFO - STDOUT: events = [{'level': 'error',
[task 2021-12-08T10:36:57.232Z] 10:36:57 INFO - 'text': 'Error: cached_message',
[task 2021-12-08T10:36:57.232Z] 10:36:57 INFO - 'timestamp': 1638959814747,
[task 2021-12-08T10:36:57.232Z] 10:36:57 INFO - 'type': 'javascript'},
[task 2021-12-08T10:36:57.232Z] 10:36:57 INFO - {'level': 'error',
[task 2021-12-08T10:36:57.233Z] 10:36:57 INFO - 'text': 'Error: live_message',
[task 2021-12-08T10:36:57.233Z] 10:36:57 INFO - 'timestamp': 1638959815319,
[task 2021-12-08T10:36:57.233Z] 10:36:57 INFO - 'type': 'javascript'},
[task 2021-12-08T10:36:57.233Z] 10:36:57 INFO - {'level': 'error',
[task 2021-12-08T10:36:57.233Z] 10:36:57 INFO - 'text': 'Error: cached_message',
[task 2021-12-08T10:36:57.233Z] 10:36:57 INFO - 'timestamp': 1638959814747,
[task 2021-12-08T10:36:57.233Z] 10:36:57 INFO - 'type': 'javascript'},
[task 2021-12-08T10:36:57.233Z] 10:36:57 INFO - {'level': 'error',
[task 2021-12-08T10:36:57.233Z] 10:36:57 INFO - 'text': 'Error: cached_message_2',
[task 2021-12-08T10:36:57.233Z] 10:36:57 INFO - 'timestamp': 1638959815345,
[task 2021-12-08T10:36:57.233Z] 10:36:57 INFO - 'type': 'javascript'}]
So we can see we have Error: cached_message
twice
Assignee | ||
Comment 2•2 years ago
|
||
Everything happens with the same window global here.
- log 'Error: cached_message'
- subscribe and check we get 'Error: cached_message' -> this works
- unsubscribe / subscribe and check we don't get 'Error: cached_message' again -> this works
- log 'Error: live_message' and check we get it -> this works
- unsubscribe
- log 'Error: cached_message_2'
- subscribe and check we get 'Error: cached_message_2' -> this fails because here we also received 'Error: cached_message' again, with the same timestamp as the first one.
All of this happens with the same ConsoleListener, and the same log module. So I think the key I used for my weakset to check if a message had already been emitted is not reliable.
In the WeakSet, I add the message object we received from the observer. But I'm guessing that if nothing else keeps the reference to this object alive, then it's going to be GC'd / deleted at some point and the next call to get cached messages will recreate a new nsIScriptError.
If that's correct, I see several things we could try:
- use a Set instead of a WeakSet (with all the concerns implied by this)
- request to have an explicit uuid on those messages
Assignee | ||
Comment 3•2 years ago
|
||
Can reproduce in mochitests by forcing a GC.
Assignee | ||
Comment 4•2 years ago
|
||
Comment 5•2 years ago
|
||
Set release status flags based on info from the regressing bug 1731574
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/28139e453b66 [bidi] Keep already emitted messages in a Set instead of a WeakSet to avoid emitting duplicate messages after GC r=webdriver-reviewers,whimboo
Comment 7•2 years ago
|
||
Regression from a P2 bug from Milestone 2. As such we should count that bug for M2 as well. Complexity wise this looks like 2 points.
Comment 8•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Comment hidden (Intermittent Failures Robot) |
Description
•