Closed Bug 639991 Opened 13 years ago Closed 13 years ago

stop_runner waits for the wrong thing

Categories

(Testing Graveyard :: Mozmill, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: k0scist, Assigned: k0scist)

References

Details

(Whiteboard: [mozmill-2.0+])

Attachments

(1 file, 1 obsolete file)

the stop_runner method demands that self.endRunnerCalled is true:

https://github.com/mozautomation/mozmill/blob/master/mozmill/mozmill/__init__.py#L309

However, this is a weird bit of logic.  Since this is (currently) set
only by javascript, this is a pretty big assumption.  For instance the
following code does not work:

import jsbridge
import mozmill
import mozprofile
import mozrunner

# boilerplate
results = mozmill.TestResults('1.2.3')
profile_args = {'addons': [mozmill.extension_path,
jsbridge.extension_path]}
runner_args = {'cmdargs': ['-jsbridge', '24242', '-foreground']}
runner = mozrunner.create_runner(mozprofile.FirefoxProfile,
                                 mozrunner.FirefoxRunner,
                                 profile_args=profile_args,
                                 runner_args=runner_args)
# instantiate a MozMill
m = mozmill.MozMill(runner, results)

# run
m.run_tests([])

What should happen is....nothing ;).  What actually happens is, after
waiting too long, you get:

(mozmill)│python test_startstop.py 
Traceback (most recent call last):
  File "test_startstop.py", line 18, in <module>
    m.run_tests([])
  File
  "/home/jhammel/mozmill/src/mozmill/mozmill/mozmill/__init__.py",
  line 239, in run_tests
    self.stop_runner()
  File
  "/home/jhammel/mozmill/src/mozmill/mozmill/mozmill/__init__.py",
  line 314, in stop_runner
    raise Exception('endRunner was never called. There must have been
    a failure in the framework')
Exception: endRunner was never called. There must have been a failure
in the framework

This severely limits our flexibility of using stop_runner.   I wanted
to utilize this for bug 638989 when I uncovered this.  While I can
work around this -- for now, at least -- for this particular problem,
in general asserting that the JS does something particular does not
make for the flexible architecture.
Whiteboard: [mozmill-2.0?]
Whiteboard: [mozmill-2.0?] → [mozmill-2.0+]
Blocks: 584470
Blocks: 627160
Depends on: 640010
Attached patch WIP (obsolete) — Splinter Review
Assignee: nobody → jhammel
Attachment #544921 - Attachment is obsolete: true
Attachment #545275 - Flags: review?(fayearthur+bugs)
(In reply to comment #3)
> Created attachment 545275 [details] [diff] [review] [review]
> use the is_running method (and fix it)

It doesn't look like you changed is_running(),  just wondering because you said it would "fix it"
(In reply to comment #4)
> (In reply to comment #3)
> > Created attachment 545275 [details] [diff] [review] [review] [review]
> > use the is_running method (and fix it)
> 
> It doesn't look like you changed is_running(),  just wondering because you
> said it would "fix it"

I just added self to the calling signature; otherwise, bad things happen
Comment on attachment 545275 [details] [diff] [review]
use the is_running method (and fix it)

looks good if you've tested.
Attachment #545275 - Flags: review?(fayearthur+bugs) → review+
Tested as best I can by hand. Somewhat hard-pressed to write tests for this sort of thing, though we should have more mozprocess tests kinda soonish
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: