Closed Bug 1680833 Opened 5 years ago Closed 5 years ago

test_presentation_sender_on_terminate_request.html and other dom/presentation tests are perma-fail on Android

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

RESOLVED INVALID

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

In bug 1643448 (and bug 1680322) we have found that the dom/presentation/tests/mochitest tests have not been running to completion on Android: one or more tests exercise an android api that causes a security exception because the ACCESS_WIFI_STATE permission has not been granted to the test application. When that permission is granted, all tests run, but some tests fail:
test_presentation_tcp_sender_disconnect.html
test_presentation_tcp_sender_establish_connection_error.html
test_presentation_sender_on_terminate_request.html

To get a green run for now, bug 1643448 will disable these tests. This bug is to investigate the test failures and get those tests running again on Android.

Depends on: 1643448

Test failures can be seen in
https://treeherder.mozilla.org/jobs?repo=try&revision=a551716117409276c4f84b1e5e9f345fb6ebcedc
For example:
https://treeherder.mozilla.org/logviewer?job_id=323612043&repo=try&lineNumber=1854

[task 2020-12-04T19:09:00.392Z] 19:09:00     INFO -  7 INFO TEST-START | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html
[task 2020-12-04T19:14:14.144Z] 19:14:14     INFO -  Buffered messages logged at 19:08:49
[task 2020-12-04T19:14:14.145Z] 19:14:14     INFO -  8 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | PresentationRequest should be available.
[task 2020-12-04T19:14:14.145Z] 19:14:14     INFO -  9 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | Sender: should have no available device after setup
[task 2020-12-04T19:14:14.145Z] 19:14:14     INFO -  10 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | Device should be available.
[task 2020-12-04T19:14:14.145Z] 19:14:14     INFO -  11 INFO Device prompt is triggered.
[task 2020-12-04T19:14:14.145Z] 19:14:14     INFO -  12 INFO A control channel is established.
[task 2020-12-04T19:14:14.146Z] 19:14:14     INFO -  13 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | Connection should be available.
[task 2020-12-04T19:14:14.146Z] 19:14:14     INFO -  14 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | Connection ID should be set.
[task 2020-12-04T19:14:14.146Z] 19:14:14     INFO -  15 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | The initial state should be connecting.
[task 2020-12-04T19:14:14.147Z] 19:14:14     INFO -  16 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | |connectionavailable| event is fired with a connection.
[task 2020-12-04T19:14:14.147Z] 19:14:14     INFO -  17 INFO TEST-PASS | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | The connection from promise and the one from |connectionavailable| event should be the same.
[task 2020-12-04T19:14:14.147Z] 19:14:14     INFO -  18 INFO The control channel is opened.
[task 2020-12-04T19:14:14.147Z] 19:14:14     INFO -  Buffered messages finished
[task 2020-12-04T19:14:14.147Z] 19:14:14  WARNING -  19 INFO TEST-UNEXPECTED-FAIL | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | Test timed out.
[task 2020-12-04T19:14:14.148Z] 19:14:14     INFO -      SimpleTest.ok@SimpleTest/SimpleTest.js:417:16
[task 2020-12-04T19:14:14.148Z] 19:14:14     INFO -      reportError@SimpleTest/TestRunner.js:143:22
[task 2020-12-04T19:14:14.148Z] 19:14:14     INFO -      TestRunner._checkForHangs@SimpleTest/TestRunner.js:165:18
[task 2020-12-04T19:14:14.148Z] 19:14:14     INFO -  20 INFO TEST-OK | dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html | took 320474ms
[task 2020-12-04T19:14:14.148Z] 19:14:14     INFO -  21 INFO The control channel is closed. 0
Component: DOM: Core & HTML → General
Product: Core → GeckoView

Just because this happens on Android it doesn't mean it's GeckoView. :jdai any reason why you believe this is GeckoView?

Component: General → DOM: Core & HTML
Flags: needinfo?(jdai)
Product: GeckoView → Core

I think I put the wrong component, it should belong to Android, not GeckoView.

Flags: needinfo?(jdai)
Severity: -- → S3

Here's a try push with disabled tests enabled and Presentation logs enabled.
https://treeherder.mozilla.org/jobs?repo=try&revision=6a157ef068b6fcac4606c865c74b04617cb7b71f

I notice "PresentationNetworkHelper::OnError: Cannot get IPv4 address", at the time of the first test hang:

2020-12-09 21:16:18.243908 UTC - [Parent 3000: Main Thread]: D/Presentation Init:ServerSocket created.port[5678]
2020-12-09 21:16:18.246507 UTC - [Parent 3000: Main Thread]: D/Presentation NotifyConnected:id[{82cade66-598d-407c-bbdf-e9f0116fedcb}], role[1]
2020-12-09 21:16:18.249017 UTC - [Parent 3000: Main Thread]: D/Presentation RegisterSessionListener:id[{82cade66-598d-407c-bbdf-e9f0116fedcb}], role[1]
2020-12-09 21:16:18.250508 UTC - [Parent 3000: Main Thread]: E/Presentation PresentationNetworkHelper::OnError: Cannot get IPv4 address
2020-12-09 21:16:22.320338 UTC - [Parent 3000: Main Thread]: D/Presentation UnregisterSessionListener:id[{ebd5dfcf-6027-4ae0-8ed8-a397458514a3}], role[1]
2020-12-09 21:16:22.320357 UTC - [Parent 3000: Main Thread]: D/Presentation Shutdown:id[{ebd5dfcf-6027-4ae0-8ed8-a397458514a3}], reason[0], role[1]
2020-12-09 21:21:38.202067 UTC - [Parent 3000: Main Thread]: D/Presentation CloseSession:id[{82cade66-598d-407c-bbdf-e9f0116fedcb}], reason[3], role[1]

Running 'mach android-emulator --version x86-7.0' locally, I see no wifi connection:

$ adb shell ifconfig
eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0 
          inet6 addr: fe80::5054:ff:fe12:3456/64 Scope: Link
          inet6 addr: fec0::5054:ff:fe12:3456/64 Scope: Site
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:4254 TX bytes:2015 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0 
          inet6 addr: ::1/128 Scope: Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:0 
          RX bytes:248 TX bytes:248 

wlan0     Link encap:Ethernet  HWaddr 02:00:00:00:00:00
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:0 TX bytes:0 

and that seems consistent with https://developer.android.com/studio/run/emulator.html#wifi.

It sounds like the emulator could provide wifi emulation with an upgraded emulator and newer android image, 7.1 or above. Updating the emulator image can be tricky and time consuming, especially if the change introduces new test failures.

:aerickson might be able to comment further?

Flags: needinfo?(aerickson)

I'll try to upgrade the emulator and image.

I haven't created one since the new taskcluster/taskgraph process (https://bugzilla.mozilla.org/show_bug.cgi?id=1624649), so it might take awhile.

Flags: needinfo?(aerickson)
Depends on: 1682991

dom/presentation is no longer in tree.

Assignee: nobody → whole.grains
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.