Open Bug 1560004 Opened 6 years ago Updated 5 years ago

Running a mochitest on Android x86 emulator with no internet connection crashes with MOZ_CRASH(Attempting to connect to non-local address!)

Categories

(Testing :: General, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: botond, Unassigned)

Details

(Whiteboard: dev-prod-2020)

Steps to reproduce

  1. Do an Android x86 build and install it on the emulator
  2. Disable internet connection
  3. Try to run a mochitest, e.g. ./mach mochitest gfx/layers/apz/test/mochitest/test_group_zoom.html.

Expected results

The mochitest runs, even in the absence of an internet connection.

Actual results

The test run crashes, with the following appearing in the logcat:

F MOZ_CRASH: Hit MOZ_CRASH(Attempting to connect to non-local address!) at /home/botond/dev/projects/mozilla/refactoring/netwerk/base/nsSocketTransport2.cpp:1285

Android mochitest serves mochitest content from httpd.js running on the desktop host. The remote mochitest profile includes network proxies which redirect test addresses like mochi.test to the network address of the desktop host. I find the non-local address exception curious, but if that was avoided, tests would still fail without a network connection between the emulator and the host.

Priority: -- → P3

(In reply to Geoff Brown [:gbrown] from comment #1)

I find the non-local address exception curious, but if that was avoided, tests would still fail without a network connection between the emulator and the host.

But a network connection between the emulator and the host doesn't require internet access, right?

Oh, right! The emulator can see the host with the special 10.0.2.2 address. So you can run

mach mochitest <test> --remote-webserver=10.0.2.2

even with no internet connection. That works for me.

(In reply to Geoff Brown [:gbrown] from comment #3)

Oh, right! The emulator can see the host with the special 10.0.2.2 address. So you can run

mach mochitest <test> --remote-webserver=10.0.2.2

even with no internet connection. That works for me.

I can confirm that this works, thanks!

So, I guess the request in this bug report would be to make it "just work" without requiring this extra argument. (And accordingly this is now a lower priority request.)

Component: Testing → General
Product: Firefox for Android → Testing
Whiteboard: dev-prod-2020
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.