Open Bug 1236952 Opened 8 years ago Updated 2 years ago

Do not terminate the HTTP server serving the tests when a debugger is being attached

Categories

(Testing :: web-platform-tests, defect)

defect

Tracking

(Not tracked)

People

(Reporter: ehsan.akhgari, Unassigned)

Details

Debugging web-platform-tests when using --debugger is a race where you need to do everything that relies on the web server in a few seconds after the browser has launched, and if you're too late, the web server is shut down and the game is over.  This breaks the following workflow:

Start debugging the test, find out some information, and get some new ideas on what to investigate, and then resume in the debugger, set new breakpoints and reload the page.  At this time the HTTP server is almost certainly dead, which forces you to quit the debugger (since you can't run the tests from a different window and attach from there as the test framework will kill the browser very fast unless if you run with --debugger.)

Keeping the HTTP server alive will make me much more productive, as I spend a considerable amount of time resetting all breakpoints in the debugger over and over again and try to get back on the same train of thought as I was on in the previous instance of the debugger.
James, can you please help here?  Thanks!
Flags: needinfo?(james)
Flags: needinfo?(james)
Off the top of my head, this seems like pretty strange behaviour; the web server shouldn't shut down until the test harness does. How are you starting the tests? Are you specifying a single test on the command line, or passing in --pause-after-test?
Flags: needinfo?(james)
Flags: needinfo?(james) → needinfo?(ehsan)
Flags: needinfo?(james)
(In reply to James Graham [:jgraham] from comment #2)
> Off the top of my head, this seems like pretty strange behaviour; the web
> server shouldn't shut down until the test harness does. How are you starting
> the tests? Are you specifying a single test on the command line, or passing
> in --pause-after-test?

I typically do something like this when I'm debugging a test:

$ ./mach web-platform-tests path/to/test.html --debugger=gdb
Flags: needinfo?(ehsan)
So I tried and I can't reproduce the server shutting down on Linux. Are you using a different platform? Do you have a complete example of the commands you enter (into the shell, into gdb) in a case where the problem reproduces?
Flags: needinfo?(james)
Flags: needinfo?(ehsan)
Hmm, I haven't tried on Linux, but this happens on Mac.  Not sure how much platform dependent stuff exists around this.

Let me try to give you a more accurate set of steps to reproduce:

1. $ ./mach web-platform-tests path/to/test.html --debugger=gdb
2. Start the browser, and break in the debugger in the middle of the test run by pressing Ctrl+C.
3. Wait for a while.

Let me know if this is exactly what you're doing.  And/Or whether there is something I can try locally that would give you more information as to what's going on.
Flags: needinfo?(ehsan)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.