Closed Bug 1538677 Opened 7 months ago Closed 7 months ago

[mozproxy] Aborting: mitmproxy playback process failed to work

Categories

(Testing :: Mozbase, defect, P1)

Version 3
defect

Tracking

(firefox-esr60 unaffected, firefox66 unaffected, firefox67 unaffected, firefox68 fixed)

RESOLVED FIXED
mozilla68
Tracking Status
firefox-esr60 --- unaffected
firefox66 --- unaffected
firefox67 --- unaffected
firefox68 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

(In reply to Andrew Creskey from bug 1532557 comment #8)

This looks to be causing a regression for me when running locally:
I now see this error:

16:50:19     INFO -  mozproxy Starting mitmproxy playback using command: /Users/acreskey/dev/src/build/obj-release/testing/mozproxy/mitmdump -k -s ""/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/playback/alternate-server-replay.py /Users/acreskey/dev/src/build/obj-release/testing/mozproxy/amazon.mp""
16:50:20     INFO -  mozproxy Aborting: mitmproxy playback process failed to work
16:50:20     INFO -  mozproxy Stopping mitmproxy playback, killing process 1852
16:50:20     INFO -  mozproxy Mitmproxy exited with error code -15

But if I run the given playback command from the terminal, mitmproxy starts up:

~/dev/src/mozilla-central$ /Users/acreskey/dev/src/build/obj-release/testing/mozproxy/mitmdump -k -s ""/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/playback/alternate-server-replay.py /Users/acreskey/dev/src/build/obj-release/testg/mozproxy/amazon.mp""
Loading script: /Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/playback/alternate-server-replay.py
Replaying from files: []
Proxy server listening at http://0.0.0.0:8080

I'm on a MacbookPro. I did make sure that there was no other instance of mitmdump running.

I see this too when trying to run Raptor tests. I'm not able to get any test running locally. I will have a look into that.

There is also the problem that the Raptor command returns with exit code 0, which would indicate that the command was executed successfully!

This error is when running tests locally.

Looks like this change was introduced recently:
https://searchfox.org/mozilla-central/source/testing/mozbase/mozproxy/mozproxy/backends/mitm.py#120

For running tests locally we get a timeout of 1 second when running the test locally in

https://searchfox.org/mozilla-central/source/testing/mozbase/mozproxy/mozproxy/backends/mitm.py#184

I would change this to 5 sec to make sure the proxy is starting properly.

Yes please just add back the sleep when running locally. Thanks!

This is not a regression from bug 1532557 but bug 1521967. At least on OS X the mitmproxy process isn't able to start within 1s, and as such it always fails. Increasing the value for local runs fixes it. I will check how we can make this more robust.

No longer blocks: 1532557

As I can see in https://hg.mozilla.org/mozilla-central/rev/b010581c27e8 the actual attempt was to only do this change for the certutil invocation, but it slipped through and also is in use for starting up the proxy.

The timeout for a mitmproxy command is only used for starting and stopping the process.

While starting the proxy uses a while loop with a delay of 1s up to the maximum allowed time, it would return early once the process is up. So there is no need to have a distinction between local or remote runs. For safety it will be better to always have a higher value here.

Stopping the process should actually not need it given that mozprocess.ProcessHandler.kill() waits for the shutdown of the process itself.

As such I would propose to partly revert the above changeset for the Mitmproxy class.

Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/38cd4d2c99a1
[mitmproxy] Allow mitmproxy commands at maximum 30s of runtime. r=rwood,tarek
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Blocks: 1527620
https://hg.mozilla.org/projects/ash/rev/38cd4d2c99a11ee976d0491c5a2fecab92418678
Bug 1538677 - [mitmproxy] Allow mitmproxy commands at maximum 30s of runtime. r=rwood,tarek
You need to log in before you can comment on or make changes to this bug.