Last Comment Bug 856999 - cfx test runner should have a flag for disabling all timeouts that can kill the process
: cfx test runner should have a flag for disabling all timeouts that can kill t...
Status: RESOLVED FIXED
:
Product: Add-on SDK
Classification: Client Software
Component: General (show other bugs)
: unspecified
: All All
: P2 normal (vote)
: ---
Assigned To: Erik Vold [:erikvold] (please needinfo? me)
:
:
Mentors:
Depends on: 1074492
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-02 03:19 PDT by Gabor Krizsanits [:krizsa :gabor]
Modified: 2014-09-29 14:34 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1620 (165 bytes, text/html)
2013-04-15 06:33 PDT, Alexandre Poirot [:ochameau]
gkrizsanits: feedback+
Details
Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1620 (46 bytes, text/x-github-pull-request)
2014-09-12 19:56 PDT, Erik Vold [:erikvold] (please needinfo? me)
jsantell: review+
Details | Review | Splinter Review

Description Gabor Krizsanits [:krizsa :gabor] 2013-04-02 03:19:14 PDT
In case of a platform feature/fix breaks a test in the SDK there should be an option to disable the process killing timeouts in the test runner, which makes it impossible to do some serious debugging.

Another great help would be to use some kind of delay flag, that waits for input before executing the tests, so a debugger can be hooked in.

I'd love to give high priority for this bug since the first part is very important now that we are going to un-hide our tests on try.
Comment 1 Alexandre Poirot [:ochameau] 2013-04-15 06:33:19 PDT
Created attachment 737473 [details]
Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1620

Here is a --no-quit option, but I'm wondering... shouldn't we rename --no-run to a "platform debugging mode" where we do various things at once?
I'm kind of concerned with the always growing number of cfx options.
So, we would have, let say --debugger-mode that would disable firefox auto kill, won't run firefox, eventually tweak test executiong time. And then we can continue tweaking this mode and add new specific behavior.
While writing this patch, I was thinking about setting an ENV variable with command to run in order to ease running the debugger and avoid painfull cmd.exe copy paste.

Also, I'm not sure delaying test executing is that usefull; Can't you set your breakpoints before running the executable?
Comment 2 Gabor Krizsanits [:krizsa :gabor] 2013-04-15 06:55:42 PDT
Comment on attachment 737473 [details]
Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1620


Can we call that flag something simple? Like --debug. So I don't use cmd.exe, I use the mozilla build tools and most of the windows developers does the same, so it's not all that bad, and the ENV var is a bit off, since no other mozilla test does that. Finally you can set the breakpoint before run on non-windows platforms for sure but for windows it's a bit more difficult. It is not impossible but is a painfull process to set up visual studio to launch the test, it's a lot easier just to attach it to an existing, running process, especially if cfx uses child processes for running the tests (or will use in the future). So for one, I'd be more than glad to have that option... it can be a sub option for the --debug flag like: cfx test --debug norun
Comment 3 Alexandre Poirot [:ochameau] 2013-04-15 08:07:44 PDT
I thought about --debug too, but it would be misleading for addon developers.
I'm inclined to think that the option name should explicitely tell that's for platform, C++ debugger stuff and that's clearly not to debug addons.

Otherwise, I'm not sure I have been clear about the env variable. I was think about something like this:

$ cfx --no-run
You can start the addon by running:
  /usr/bin/firefox -profile .... -no-remote
or
  $RUN_JETPACK

$ gdb --args $RUN_JETPACK

It might not be usefull for you on windows, but handy on linux/gdb.
Comment 4 Gabor Krizsanits [:krizsa :gabor] 2013-04-16 02:17:33 PDT
(In reply to Alexandre Poirot (:ochameau) from comment #3)
> I thought about --debug too, but it would be misleading for addon developers.
> I'm inclined to think that the option name should explicitely tell that's
> for platform, C++ debugger stuff and that's clearly not to debug addons.

Is it? I think it might be handy if you want to debug the test itself at js level, when you are implementing a test, and want to attach a remote debugger to it... Might not be possible now, but once it is available it is the very same story, or am I wrong?

> 
> Otherwise, I'm not sure I have been clear about the env variable. I was
> think about something like this:
> 
> $ cfx --no-run
> You can start the addon by running:
>   /usr/bin/firefox -profile .... -no-remote
> or
>   $RUN_JETPACK
> 
> $ gdb --args $RUN_JETPACK
> 
> It might not be usefull for you on windows, but handy on linux/gdb.

Yeah I got it, and as a second thought just because other test does not have this it does not mean it's a bad idea. So sure, someone will be happy for it I'm sure.
Comment 5 Alexandre Poirot [:ochameau] 2014-02-03 07:17:59 PST
Looks like I won't have time to look at SDK bugs anymore.
Comment 6 Erik Vold [:erikvold] (please needinfo? me) 2014-09-12 19:56:17 PDT
Created attachment 8488955 [details] [review]
Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1620
Comment 7 Erik Vold [:erikvold] (please needinfo? me) 2014-09-12 19:57:04 PDT
Comment on attachment 737473 [details]
Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1620

See https://github.com/mozilla/addon-sdk/pull/1620 now
Comment 8 [github robot] 2014-09-17 13:43:31 PDT
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/342154b2c27e2bfd4e589369f0effe162f2ef191
Bug 856999: Add --no-quit option to prevent from killing firefox when running tests.

https://github.com/mozilla/addon-sdk/commit/8284e8ee1255b6112c0711ec1219d103f0c6bf7b
Merge branch 'master' of https://github.com/mozilla/addon-sdk into bug856999

Conflicts:
	app-extension/bootstrap.js
	lib/sdk/system.js
	python-lib/cuddlefish/__init__.py

https://github.com/mozilla/addon-sdk/commit/9a614d99572fddf9b2ed29d97aa457cecb58fd6a
Bug 856999: fix for using --no-quit and --stop-on-error together, which was quiting before

https://github.com/mozilla/addon-sdk/commit/d3c9f43f091937c756c725dd44826c61752926cf
Merge pull request #1620 from erikvold/856999

Bug 856999: Add --no-quit option to prevent from killing firefox when running tests r=@jsantell

Note You need to log in before you can comment on or make changes to this bug.