dom/media/webrtc/tests/mochitests/test_peerConnection_basicAudioNATRelayTCP.html perma-fail on Windows 7 with python 3
Categories
(Testing :: Mochitest, defect)
Tracking
(Not tracked)
People
(Reporter: gbrown, Assigned: gbrown)
References
Details
Some dom/media/webrtc tests become perma-fail on Windows 7 when mochitests are run with python 3.
Compare python 2:
https://treeherder.mozilla.org/jobs?repo=try&revision=801f9a71d96c21b9f41aca2eab37ca522430f363
python 3:
https://treeherder.mozilla.org/jobs?repo=try&revision=6c3cbc8aadeca272cf82e58e0b7fb74910bddcf5
Most mochitests run fine under python 3, and these tests pass under python 3 on other test platforms, even Windows 10.
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 years ago
|
||
https://treeherder.mozilla.org/logviewer?job_id=333453623&repo=try
[task 2021-03-16T22:27:32.116Z] 22:27:32 INFO - TEST-START | dom/media/webrtc/tests/mochitests/test_peerConnection_basicAudioNATRelayTCP.html
[task 2021-03-16T22:27:32.479Z] 22:27:32 INFO - GECKO(6096) | Timecard created 1615933650.031000
[task 2021-03-16T22:27:32.479Z] 22:27:32 INFO - GECKO(6096) | Timestamp | Delta | Event | File | Function
[task 2021-03-16T22:27:32.486Z] 22:27:32 INFO - GECKO(6096) | ======================================================================================================================
[task 2021-03-16T22:27:32.486Z] 22:27:32 INFO - GECKO(6096) | 0.000000 | 0.000000 | Constructor Completed | PeerConnectionImpl.cpp:326 | PeerConnectionImpl
[task 2021-03-16T22:27:32.486Z] 22:27:32 INFO - GECKO(6096) | 0.000000 | 0.000000 | Initializing PC Ctx | PeerConnectionImpl.cpp:444 | Initialize
[task 2021-03-16T22:27:32.486Z] 22:27:32 INFO - GECKO(6096) | 0.200000 | 0.200000 | Set Remote Description | PeerConnectionImpl.cpp:1375 | SetRemoteDescription
[task 2021-03-16T22:27:32.486Z] 22:27:32 INFO - GECKO(6096) | 0.262000 | 0.062000 | Create Answer | PeerConnectionImpl.cpp:1237 | CreateAnswer
[task 2021-03-16T22:27:32.486Z] 22:27:32 INFO - GECKO(6096) | 0.270000 | 0.008000 | Set Local Description | PeerConnectionImpl.cpp:1275 | SetLocalDescription
[task 2021-03-16T22:27:32.487Z] 22:27:32 INFO - GECKO(6096) | 0.300000 | 0.030000 | Ice gathering state: gathering | PeerConnectionImpl.cpp:2523 | IceGatheringStateChange
[task 2021-03-16T22:27:32.488Z] 22:27:32 INFO - GECKO(6096) | 0.402000 | 0.102000 | Ice state: checking | PeerConnectionImpl.cpp:2467 | IceConnectionStateChange
[task 2021-03-16T22:27:32.489Z] 22:27:32 INFO - GECKO(6096) | 0.503000 | 0.101000 | Ice gathering state: complete | PeerConnectionImpl.cpp:2526 | IceGatheringStateChange
[task 2021-03-16T22:27:32.489Z] 22:27:32 INFO - GECKO(6096) | 0.815000 | 0.312000 | Ice state: connected | PeerConnectionImpl.cpp:2470 | IceConnectionStateChange
[task 2021-03-16T22:27:32.490Z] 22:27:32 INFO - GECKO(6096) | 2.437000 | 1.622000 | Destructor Invoked | PeerConnectionImpl.cpp:335 | ~PeerConnectionImpl
[task 2021-03-16T22:27:32.491Z] 22:27:32 INFO - GECKO(6096) | [Child 3676: Main Thread]: I/signaling [main|PeerConnectionImpl] PeerConnectionImpl.cpp:360: ~PeerConnectionImpl: PeerConnectionImpl destructor invoked for {d74a4873-f8e3-490d-b3f1-a5d9b6e6c976}
[task 2021-03-16T22:27:32.491Z] 22:27:32 INFO - GECKO(6096) | Timecard created 1615933650.024000
[task 2021-03-16T22:27:32.492Z] 22:27:32 INFO - GECKO(6096) | Timestamp | Delta | Event | File | Function
[task 2021-03-16T22:27:32.493Z] 22:27:32 INFO - GECKO(6096) | ======================================================================================================================
[task 2021-03-16T22:27:32.494Z] 22:27:32 INFO - GECKO(6096) | 0.000000 | 0.000000 | Constructor Completed | PeerConnectionImpl.cpp:326 | PeerConnectionImpl
[task 2021-03-16T22:27:32.495Z] 22:27:32 INFO - GECKO(6096) | 0.001000 | 0.001000 | Initializing PC Ctx | PeerConnectionImpl.cpp:444 | Initialize
[task 2021-03-16T22:27:32.495Z] 22:27:32 INFO - GECKO(6096) | 0.164000 | 0.163000 | Create Offer | PeerConnectionImpl.cpp:1206 | CreateOffer
[task 2021-03-16T22:27:32.496Z] 22:27:32 INFO - GECKO(6096) | 0.177000 | 0.013000 | Set Local Description | PeerConnectionImpl.cpp:1275 | SetLocalDescription
[task 2021-03-16T22:27:32.497Z] 22:27:32 INFO - GECKO(6096) | 0.189000 | 0.012000 | Ice gathering state: gathering | PeerConnectionImpl.cpp:2523 | IceGatheringStateChange
[task 2021-03-16T22:27:32.498Z] 22:27:32 INFO - GECKO(6096) | 0.202000 | 0.013000 | Ice gathering state: complete | PeerConnectionImpl.cpp:2526 | IceGatheringStateChange
[task 2021-03-16T22:27:32.498Z] 22:27:32 INFO - GECKO(6096) | 0.513000 | 0.311000 | Set Remote Description | PeerConnectionImpl.cpp:1375 | SetRemoteDescription
[task 2021-03-16T22:27:32.499Z] 22:27:32 INFO - GECKO(6096) | 0.706000 | 0.193000 | Ice state: checking | PeerConnectionImpl.cpp:2467 | IceConnectionStateChange
[task 2021-03-16T22:27:32.500Z] 22:27:32 INFO - GECKO(6096) | 0.819000 | 0.113000 | Ice state: connected | PeerConnectionImpl.cpp:2470 | IceConnectionStateChange
[task 2021-03-16T22:27:32.500Z] 22:27:32 INFO - GECKO(6096) | 2.451000 | 1.632000 | Destructor Invoked | PeerConnectionImpl.cpp:335 | ~PeerConnectionImpl
[task 2021-03-16T22:27:32.501Z] 22:27:32 INFO - GECKO(6096) | [Child 3676: Main Thread]: I/signaling [main|PeerConnectionImpl] PeerConnectionImpl.cpp:360: ~PeerConnectionImpl: PeerConnectionImpl destructor invoked for {b4267bc5-3e8f-4139-adb9-fe78ec6e6af2}
[task 2021-03-16T22:27:33.357Z] 22:27:33 INFO - GECKO(6096) | TEST DEVICES: No test device found in media.audio_loopback_dev, using fake audio streams.
[task 2021-03-16T22:27:33.358Z] 22:27:33 INFO - GECKO(6096) | TEST DEVICES: No test device found in media.video_loopback_dev, using fake video streams.
[task 2021-03-16T22:27:33.954Z] 22:27:33 INFO - TEST-INFO | started process screenshot
[task 2021-03-16T22:27:34.026Z] 22:27:34 INFO - TEST-INFO | screenshot: exit 0
[task 2021-03-16T22:27:34.027Z] 22:27:34 INFO - Buffered messages logged at 22:27:33
[task 2021-03-16T22:27:34.030Z] 22:27:34 INFO - TEST-PASS | dom/media/webrtc/tests/mochitests/test_peerConnection_basicAudioNATRelayTCP.html | A valid string reason is expected
[task 2021-03-16T22:27:34.031Z] 22:27:34 INFO - TEST-PASS | dom/media/webrtc/tests/mochitests/test_peerConnection_basicAudioNATRelayTCP.html | Reason cannot be empty
[task 2021-03-16T22:27:34.031Z] 22:27:34 INFO - TEST-PASS | dom/media/webrtc/tests/mochitests/test_peerConnection_basicAudioNATRelayTCP.html | A valid string reason is expected
[task 2021-03-16T22:27:34.031Z] 22:27:34 INFO - TEST-PASS | dom/media/webrtc/tests/mochitests/test_peerConnection_basicAudioNATRelayTCP.html | Reason cannot be empty
[task 2021-03-16T22:27:34.031Z] 22:27:34 INFO - websocket/process bridge open, starting ICE Server...
[task 2021-03-16T22:27:34.031Z] 22:27:34 INFO - ICE Server: Traceback (most recent call last):
[task 2021-03-16T22:27:34.031Z] 22:27:34 INFO - Buffered messages finished
[task 2021-03-16T22:27:34.031Z] 22:27:34 INFO - TEST-UNEXPECTED-FAIL | dom/media/webrtc/tests/mochitests/test_peerConnection_basicAudioNATRelayTCP.html | Error executing test: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data setupIceServerConfig/<@http://mochi.test:8888/tests/dom/media/webrtc/tests/mochitests/pc.js:2504:30 ...
[task 2021-03-16T22:27:34.032Z] 22:27:34 INFO - SimpleTest.ok@SimpleTest/SimpleTest.js:417:16
[task 2021-03-16T22:27:34.032Z] 22:27:34 INFO - runTestWhenReady/<@dom/media/webrtc/tests/mochitests/head.js:475:9
[task 2021-03-16T22:27:34.032Z] 22:27:34 INFO - GECKO(6096) | MEMORY STAT | vsize 570MB | vsizeMaxContiguous 512MB | residentFast 94MB | heapAllocated 6MB
[task 2021-03-16T22:27:34.032Z] 22:27:34 INFO - ICE Server: File "Z:\task_1615932968\build\venv\lib\site-packages\twisted\internet\udp.py", line 196, in _bindSocket
[task 2021-03-16T22:27:34.032Z] 22:27:34 INFO - ICE Server: skt.bind((self.interface, self.port))
[task 2021-03-16T22:27:34.032Z] 22:27:34 INFO - ICE Server: OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted
[task 2021-03-16T22:27:34.033Z] 22:27:34 INFO - ICE Server:
[task 2021-03-16T22:27:34.033Z] 22:27:34 INFO - ICE Server: During handling of the above exception, another exception occurred:
[task 2021-03-16T22:27:34.033Z] 22:27:34 INFO - ICE Server:
[task 2021-03-16T22:27:34.033Z] 22:27:34 INFO - ICE Server: Traceback (most recent call last):
[task 2021-03-16T22:27:34.034Z] 22:27:34 INFO - ICE Server: File "iceserver\iceserver.py", line 817, in <module>
[task 2021-03-16T22:27:34.034Z] 22:27:34 INFO - ICE Server: reactor.listenUDP(3478, UdpStunHandler(), interface=interface_4)
[task 2021-03-16T22:27:34.035Z] 22:27:34 INFO - ICE Server: File "Z:\task_1615932968\build\venv\lib\site-packages\twisted\internet\posixbase.py", line 369, in listenUDP
[task 2021-03-16T22:27:34.036Z] 22:27:34 INFO - ICE Server: p.startListening()
[task 2021-03-16T22:27:34.036Z] 22:27:34 INFO - ICE Server: File "Z:\task_1615932968\build\venv\lib\site-packages\twisted\internet\udp.py", line 178, in startListening
[task 2021-03-16T22:27:34.037Z] 22:27:34 INFO - ICE Server: self._bindSocket()
[task 2021-03-16T22:27:34.038Z] 22:27:34 INFO - ICE Server: File "Z:\task_1615932968\build\venv\lib\site-packages\twisted\internet\udp.py", line 198, in _bindSocket
[task 2021-03-16T22:27:34.038Z] 22:27:34 INFO - ICE Server: raise error.CannotListenError(self.interface, self.port, le)
[task 2021-03-16T22:27:34.040Z] 22:27:34 INFO - ICE Server: twisted.internet.error.CannotListenError: Couldn't listen on 10.143.21.88:3478: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted.
[task 2021-03-16T22:27:34.041Z] 22:27:34 INFO - ICE Server: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ProcessTerminated'>: A process has ended with a probable error condition: process ended with exit code 1.
[task 2021-03-16T22:27:34.041Z] 22:27:34 INFO - ICE Server: ]
[task 2021-03-16T22:27:34.042Z] 22:27:34 INFO - ICE Server websocket closed
[task 2021-03-16T22:27:34.043Z] 22:27:34 INFO - TEST-OK | dom/media/webrtc/tests/mochitests/test_peerConnection_basicAudioNATRelayTCP.html | took 1878ms
| Assignee | ||
Comment 2•5 years ago
|
||
From comment 1:
Error executing test: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data setupIceServerConfig/<@http://mochi.test:8888/tests/dom/media/webrtc/tests/mochitests/pc.js:2504:30 ...
https://searchfox.org/mozilla-central/rev/650f5d23bb7d2d59308e6afdc14ceab403c9b6a7/dom/media/webrtc/tests/mochitests/pc.js#2504
https://searchfox.org/mozilla-central/rev/650f5d23bb7d2d59308e6afdc14ceab403c9b6a7/dom/media/webrtc/tests/mochitests/pc.js#2482
So I think pc.js is only failing because of the iceserver.py stacks.
| Assignee | ||
Comment 3•5 years ago
|
||
If I skip the test before test_peerConnection_basicAudioNATRelayTCP.html, then test_peerConnection_basicAudioNATRelayTCP.html passes and the next test fails -- as though a resource is not being freed up at the end of a test.
| Assignee | ||
Comment 4•5 years ago
|
||
I suspect that the issue is that the iceserver.py does not end cleanly and leaves its server listening socket open; when the next test re-starts iceserver.py, it finds the well-known port busy and fails.
Shutdown is initiated by runtests.py, which kills the websocketprocessbridge:
https://searchfox.org/mozilla-central/rev/1758450798ae14492ba28b695f48143840ad6c5b/testing/mochitest/runtests.py#1332
Under py2, on linux, windows 7 and windows 10, that results in a socketGone notification, which then kills the iceserver:
https://searchfox.org/mozilla-central/rev/1758450798ae14492ba28b695f48143840ad6c5b/testing/tools/websocketprocessbridge/websocketprocessbridge.py#47
It's wonderful that this works on all of our test platforms under py 2, but it is risky:
- killing might not close open sockets
- the pathway from kill to socketGone is unclear
- os.kill and signal trapping can be troublesome on Windows, and varies from py 2 to py 3: https://stackoverflow.com/questions/35772001/how-to-handle-the-signal-in-python-on-windows-machine
Under py 3, on Linux, everything continues to work as expected.
Under py 3, on Windows, the socketGone notification is not triggered and both the websocketprocessbridge and iceserver are killed abruptly; on Windows 7 that seems to leave the port busy.
| Assignee | ||
Comment 5•5 years ago
|
||
Is the socket only temporarily in use? Would a retry a little later work? It appears not:
https://treeherder.mozilla.org/jobs?repo=try&revision=3ac786da1e547b18be145f786e77f48371d4b7bf
Attempts to retry the listen every minute continue to fail, at least for 5 minutes (beyond 5 minutes, things get more confused, because new iceserver processes are spawned, and then we have multiple processes attempting to listen on the same socket!).
| Assignee | ||
Comment 6•5 years ago
|
||
Finally, some progress:
https://treeherder.mozilla.org/jobs?repo=try&revision=7411683bab2c5fb7b63b5a7364756629f5748a43
This feels like a brute-force hack, but it's the only way I have yet gotten a passing run: Instead of killing the websocket process bridge from the harness, use a file to signal the websocket process bridge to shut down cleanly; similarly, instead of killing the iceserver from the websocket process bridge, use a file to signal the iceserver to shut down cleanly.
| Assignee | ||
Comment 7•5 years ago
|
||
Unfortunately, even with that change, the socket is still intermittently busy, on various platforms:
https://treeherder.mozilla.org/jobs?repo=try&revision=743a1054804cc413e6e9dab00e2ebdf5d11523d3
| Assignee | ||
Comment 8•5 years ago
|
||
Hopefully someone else will have better luck with this bug! (Otherwise, a possible way forward is to stop running mochitest-media, or at least iceserver-dependent tests, on Windows 7.)
| Assignee | ||
Comment 9•5 years ago
|
||
Bug 1707945 moved mochitest-media off of windows 7, which should effectively resolve this issue.
Description
•