Fwd: Martian documents?

135 views
Skip to first unread message

Bramha Ghosh

unread,
Mar 20, 2019, 5:02:08 PM3/20/19
to martianproxy-users


---------- Forwarded message ---------
From: Bramha Ghosh <bra...@google.com>
Date: Wed, Mar 20, 2019 at 1:54 PM
Subject: Re: Martian documents?
To: Yahan Zhou <ya...@google.com>, MartianProxy <martia...@google.com>
Cc: Yuki Hamada <hum...@google.com>, Arif Sukoco <ar...@google.com>


+MartianProxy (for posterity)

When Martian starts it is listening on 2 ports that get passed in at start time. In the case of this test, that port picking happens via the hermetic_server launcher, which starts as a part of the test setup.
The 2 ports that Martian listens over are 
  1. the port over which traffic to be proxied is transmitted - the traffic port
  2. the port over which control messages to the Martian instance are sent - the API port
The sponge link you sent over has this line:
java.net.ConnectException: Failed to connect to votl5.prod.google.com/2002:ac5:8b85:::8888

Which makes me think that the port is wrong

For that test run, Martian started on ports 22201 and 22202 (log)
Starting Martian proxy on port 22201 with api port 22202...
and it looks like it's trying to connect over port 8888 - not sure where that port is coming from, because I think this is the Martian implementation that test starts up, and neither default port is 8888.

(1) Does Android establishes Martian connections before all tests and tear it down after all tests? Or does it re-establish the connection between tests? Or test writers can change between those two?

This is really all a matter of specific implementations - Martian has no opinion about when it is started and stopped in the life-cycle of the test - but the ports over which it is listening cannot change at run-time.
The way hermetic_server works is that it treats Martian as a generic server that needs started, does the appropriate port picking, and sets the "server" to proxy traffic through via the proxy_server_name flag (Skylark macro example).

On Wed, Mar 20, 2019 at 1:00 PM Yahan Zhou <ya...@google.com> wrote:
Hi Bramha,

This is Yahan from the Android emulator team. We are testing a snapshot test runner on Google3 and experience Martian issues. So we want to learn more about how Martian works in Android testing and see if there would be any workarounds.

The problem is as followed. We are building a new test runner which performs virtual machine snapshot between tests. When snapshot happens it is very likely to mess up all Android network connections. We saw Martian failures that seem to be related to it. So we want to learn more about Martian. Specifically, when testing:

(1) Does Android establishes Martian connections before all tests and tear it down after all tests? Or does it re-establish the connection between tests? Or test writers can change between those two?

(2) Is there any design doc we can refer to?

Also here is a sample sponge log:


Thanks,
Yahan
Reply all
Reply to author
Forward
0 new messages