Closed Bug 1453596 Opened 6 years ago Closed 6 years ago

Hang in "startServers" when the file "server_alive.txt" cannot be created in server.js

Categories

(Testing :: Mochitest, defect, P1)

defect

Tracking

(firefox59 wontfix, firefox60 fixed, firefox61 fixed)

RESOLVED FIXED
mozilla61
Tracking Status
firefox59 --- wontfix
firefox60 --- fixed
firefox61 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

I can see a hang in `startServers()` specifically in `MochitestServer.ensureReady()` when the "server_alive.txt" file cannot be created by Mochitest server component:

https://dxr.mozilla.org/mozilla-central/rev/cfe6399e142c71966ef58a16cfd52c0b46dc6b1e/testing/mochitest/runtests.py#492-506

https://dxr.mozilla.org/mozilla-central/rev/cfe6399e142c71966ef58a16cfd52c0b46dc6b1e/testing/mochitest/server.js#177-184

This happens when a profile path has been specified with eg. a Unicode character in the Mochitest harness, and `serverAlive.exists()` returns false. Given that there is no else block with a proper failure message, the harness just times out.
Depends on: 1453647
Actually we cannot get rid of the hang in such a situation but we can at least provide a Javascript error which then can be picked up by Treeherder for the error line.

The underlying problem here is in xpcshell which is covered via bug 1453647.
Attachment #8967345 - Flags: review?(gbrown)
Comment on attachment 8967346 [details]
Bug 1453596 - [mochitest] Throw errors instead of strings to get line numbers.

https://reviewboard.mozilla.org/r/236044/#review241836
Attachment #8967346 - Flags: review?(gbrown) → review+
Comment on attachment 8967345 [details]
Bug 1453596 - [mochitest] Throw exception if path for server alive file doesn't exist.

https://reviewboard.mozilla.org/r/236042/#review241842

::: testing/mochitest/server.js:176
(Diff revision 1)
>    } else {
>      serverAlive.initWithPath(_PROFILE_PATH);
>    }
>  
>    // If we're running outside of the test harness, there might
>    // not be a test profile directory present

This comment seems a little misleading - maybe worth updating, or just deleting the comment?
Attachment #8967345 - Flags: review?(gbrown) → review+
Comment on attachment 8967345 [details]
Bug 1453596 - [mochitest] Throw exception if path for server alive file doesn't exist.

https://reviewboard.mozilla.org/r/236042/#review241842

> This comment seems a little misleading - maybe worth updating, or just deleting the comment?

Misleading in which sense? Mochitest for example sets the _PROFILE_PATH, which might then not be present.
I think the comment makes it sound like server.js does not always expect the directory to be present -- as though it is okay for the directory not to exist. But actually, if the directory does not exist, we will throw an error (now). Maybe that's just my interpretation.
I see. I will update the commit.
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/14d208836dd3
[mochitest] Throw exception if path for server alive file doesn't exist. r=gbrown
https://hg.mozilla.org/integration/autoland/rev/e67b96dc309c
[mochitest] Throw errors instead of strings to get line numbers. r=gbrown
https://hg.mozilla.org/mozilla-central/rev/14d208836dd3
https://hg.mozilla.org/mozilla-central/rev/e67b96dc309c
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Stability improvements for mochitest which would be good to see uplifted to mozilla-beta.
Whiteboard: [checkin-needed-beta]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: