Closed
Bug 1103159
Opened 10 years ago
Closed 10 years ago
UnboundLocalError: local variable 'result' referenced before assignment with --e10s and --total-chunks
Categories
(Testing :: Mochitest, defect)
Testing
Mochitest
Tracking
(e10s+)
RESOLVED
FIXED
mozilla37
Tracking | Status | |
---|---|---|
e10s | + | --- |
People
(Reporter: mccr8, Assigned: vaibhav1994)
References
(Blocks 1 open bug)
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
1004 bytes,
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
Running this:
./mach mochitest-browser --e10s --total-chunks 10 --this-chunk 10
Gives me this:
From _tests: Kept 33741 existing; Added/updated 0; Removed 0 files and 0 directories.
TEST-INFO | checking window state
Browser Chrome Test Summary
Passed: 0
Failed: 0
Todo: 0
*** End BrowserChrome Test Results ***
Error running mach:
['mochitest-browser', '--e10s', '--total-chunks', '10', '--this-chunk', '10']
The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You should consider filing a bug for this issue.
If filing a bug, please include the full output of mach, including this error
message.
The details of the failure are as follows:
UnboundLocalError: local variable 'result' referenced before assignment
File "/home/amccreight/mc/testing/mochitest/mach_commands.py", line 662, in run_mochitest_browser
return self.run_mochitest(test_paths, 'browser', **kwargs)
File "/home/amccreight/mc/testing/mochitest/mach_commands.py", line 785, in run_mochitest
test_paths=test_paths, suite=flavor, **kwargs)
File "/home/amccreight/mc/testing/mochitest/mach_commands.py", line 390, in run_desktop_test
result = runner.runTests(options)
File "/home/amccreight/mc/obj-dbg/_tests/testing/mochitest/runtests.py", line 1764, in runTests
return result
Removing the two chunk arguments, or the --e10s, makes the error go away.
Reporter | ||
Comment 1•10 years ago
|
||
This looks like it may have broken in bug 1036374, which added the |return result| without defining result on all return paths.
Reporter | ||
Comment 2•10 years ago
|
||
It works fine with total-chunks=3, so maybe the problem is that with total-chunks=10 the set of directories is empty?
Comment 3•10 years ago
|
||
ahh, most likely that is the case! I suspect we can make a better error for the case when there are no chunks.
Comment 5•10 years ago
|
||
Not being able to run e10s tests locally is quite bad.
Blocks: 1036374
Keywords: regression
Reporter | ||
Comment 6•10 years ago
|
||
I was able to run them, it was just that the final chunk was empty in some cases and I got this weird message.
Assignee | ||
Comment 7•10 years ago
|
||
This patch will ensure that the directories being run is non-empty and then only return the result parameter, thus not giving rise to this error.
Attachment #8539450 -
Flags: review?(jmaher)
Comment 8•10 years ago
|
||
Comment on attachment 8539450 [details] [diff] [review]
bug1103159.patch
Review of attachment 8539450 [details] [diff] [review]:
-----------------------------------------------------------------
Please make this return a value:
0 = green
1 = orange
since there are no tests run, this probably should be a value of 1
::: testing/mochitest/runtests.py
@@ +1786,5 @@
> print "3 INFO Todo: %s" % self.counttodo
> print "4 INFO SimpleTest FINISHED"
>
> + if dirs:
> + return result
I would rather set result to a default value and always return something. We use the return code from here when we sys.ext()
Attachment #8539450 -
Flags: review?(jmaher) → review-
Assignee | ||
Comment 9•10 years ago
|
||
Placed a default value for result variable.
Attachment #8539450 -
Attachment is obsolete: true
Attachment #8539467 -
Flags: review?(jmaher)
Comment 10•10 years ago
|
||
Comment on attachment 8539467 [details] [diff] [review]
bug1103159.patch
Review of attachment 8539467 [details] [diff] [review]:
-----------------------------------------------------------------
thanks, how does this look locally. Make sure whilst running this locally and hitting this condition that the ./mach termination makes sense.
Attachment #8539467 -
Flags: review?(jmaher) → review+
Assignee | ||
Comment 11•10 years ago
|
||
vaibhav@vaibhav:~/mozilla-inbound$ ./mach mochitest-browser --e10s --total-chunks 10 --this-chunk 10
Build configuration changed. Regenerating backend.
Reticulating splines...
Finished reading 2748 moz.build files in 2.13s
Processed into 7569 build config descriptors in 1.71s
Backend executed in 2.74s
2265 total backend files; 0 created; 1 updated; 2264 unchanged; 0 deleted; 139 -> 852 Makefile
Total wall time: 6.86s; CPU time: 6.41s; Efficiency: 93%; Untracked: 0.29s
From _tests: Kept 34202 existing; Added/updated 0; Removed 0 files and 0 directories.
TEST-INFO | checking window state
Browser Chrome Test Summary
Passed: 0
Failed: 0
Todo: 0
*** End BrowserChrome Test Results ***
0 ERROR Got suite_end message before suite_start.
This is the output. It shows that 0 tests are run. The last error is occurring because of
bug 1060439.
Comment 12•10 years ago
|
||
this looks great, thanks!
Assignee | ||
Comment 13•10 years ago
|
||
Assignee: nobody → vaibhavmagarwal
Comment 15•10 years ago
|
||
Keywords: checkin-needed
Comment 16•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in
before you can comment on or make changes to this bug.
Description
•