Commit c263347
committed
server: Disable automatic retry when exiting from debug mode
* In debug mode, never retry (maxTries = 1).
* Fix "TypeError: Cannot read properties of undefined 'clientId'"
at the end of certain debugging scenarios.
When a browser is unable to complete a test run (i.e. some files
don't load the the test gets stuck), the server will relay the
console error messages, and eventually declare an idle timeout
and stop the browser.
In debug mode, we intercept the browser.stop() and leave it open.
This works by swapping out the signal for a dummy signal.
However, this meant that at the end of launchBrowserAttempt,
where we check `signal.reason` that we have no signal.reason,
and thus we try to return `result` instead of throwing.
First: Remove the possiblity of this happening by not checking
`signal.reason`. If we have no result, just throw. Returning
undefined is not allowed under our contract and needlessly
complicates the return handling for eventbus and reporters.
Second: Fix the throw to throw the original signal's reason.
The dummy signal should only affect what we send to the browser
process in order to keep it open, we should not dummy ourselves
as well. This means that if the test run finished normally then,
once the developer ends their debug session we will return the
result. Otherwise, we throw whatever the orignal reason was
before we overrode it to keep the browser open (e.g. idle timeout).
While at it, remove debug statements from LocalBrowser.spawn that
are redundant with server.js/launchBrowser (browser_launch_exit,
and browser_launch_error). This was moved there so that browser
plugins for QTap won't need to worry about this.1 parent e897467 commit c263347
2 files changed
+9
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
| 243 | + | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | 248 | | |
250 | 249 | | |
251 | 250 | | |
| |||
374 | 373 | | |
375 | 374 | | |
376 | 375 | | |
377 | | - | |
| 376 | + | |
378 | 377 | | |
379 | 378 | | |
380 | 379 | | |
381 | 380 | | |
382 | 381 | | |
383 | 382 | | |
384 | | - | |
| 383 | + | |
385 | 384 | | |
386 | | - | |
| 385 | + | |
387 | 386 | | |
388 | 387 | | |
389 | 388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| 114 | + | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
| |||
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
157 | | - | |
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
164 | | - | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
0 commit comments