qunit-phantomjs-runner icon indicating copy to clipboard operation
qunit-phantomjs-runner copied to clipboard

Race Conditions

Open stefanpenner opened this issue 9 years ago • 6 comments

  • https://github.com/jonkemp/qunit-phantomjs-runner/blob/master/runner.js#L44 can run before https://github.com/jonkemp/qunit-phantomjs-runner/blob/master/runner.js#L66
  • https://github.com/jonkemp/qunit-phantomjs-runner/blob/master/runner.js#L98 can run before QUnit loads

Solution is most likely to do the following:

  • disable QUnit autostart
  • onload:
    • attach logger
    • manually start tests via QUnit.start()

@trentmwillis thoughts on the QUnit side? If you have a better idea for coordinating the runner + qunit boot.

stefanpenner avatar Jul 01 '16 20:07 stefanpenner

From my cursory glance, it seems like disabling autostart is the best way to go. Lots of async setup going on it seems.

trentmwillis avatar Jul 01 '16 21:07 trentmwillis

@trentmwillis is there a way to set that configurable before QUnit is loaded?

stefanpenner avatar Jul 01 '16 22:07 stefanpenner

Unfortunately no, at least no way that I am aware of.

trentmwillis avatar Jul 02 '16 02:07 trentmwillis

@trentmwillis any apposition to me submitting a PR for it?

stefanpenner avatar Jul 11 '16 14:07 stefanpenner

For pre-configuring QUnit? I'm not opposed, but we'd probably want to open it up for discussion with the rest of the team to determine an API

trentmwillis avatar Jul 11 '16 16:07 trentmwillis

@trentmwillis maybe a meta tag? Ya, i'll try to open a discussion later this week.

stefanpenner avatar Jul 11 '16 17:07 stefanpenner