+MartianProxy (for posterity)
When Martian starts it is l
istening 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
- the port over which traffic to be proxied is transmitted - the traffic port
- the port over which control messages to the Martian instance are sent - the API port
The sponge link you sent over has this line:
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).