Closed Bug 1675306 Opened 4 years ago Closed 4 years ago

Permafailing tier 2 python/mozbuild/mozbuild/test/configure/test_checks_configure.py::TestChecksConfigure::test_java_tool_checks TEST-UNEXPECTED-FAIL

Categories

(Firefox Build System :: General, defect, P5)

defect

Tracking

(firefox-esr78 unaffected, firefox82 unaffected, firefox83 unaffected, firefox84 fixed)

RESOLVED FIXED
84 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox82 --- unaffected
firefox83 --- unaffected
firefox84 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: mhentges)

References

(Regression)

Details

(Keywords: intermittent-failure, regression, Whiteboard: [stockwell disable-recommended])

Attachments

(1 file)

Filed by: ncsoregi [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=320727640&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/f8VSHNDuTW-VEgLA65Fsaw/runs/0/artifacts/public/logs/live_backing.log


[task 2020-11-04T16:01:43.080Z]  0:14.74 python/mozbuild/mozbuild/test/configure/test_checks_configure.py::TestChecksConfigure::test_id_and_secret_keyfile PASSED
[task 2020-11-04T16:01:43.081Z]  0:14.74 python/mozbuild/mozbuild/test/configure/test_checks_configure.py::TestChecksConfigure::test_java_tool_checks TEST-UNEXPECTED-FAIL
[task 2020-11-04T16:01:43.081Z]  0:14.74 python/mozbuild/mozbuild/test/configure/test_checks_configure.py::TestChecksConfigure::test_pkg_check_modules PASSED
[task 2020-11-04T16:01:43.081Z]  0:14.74 python/mozbuild/mozbuild/test/configure/test_checks_configure.py::TestChecksConfigure::test_simple_keyfile PASSED
[task 2020-11-04T16:01:43.082Z]  0:14.74 
[task 2020-11-04T16:01:43.082Z]  0:14.74 =================================== FAILURES ===================================
[task 2020-11-04T16:01:43.082Z]  0:14.74 __________________ TestChecksConfigure.test_java_tool_checks ___________________
[task 2020-11-04T16:01:43.083Z]  0:14.74 
[task 2020-11-04T16:01:43.083Z]  0:14.74 self = <test_checks_configure.TestChecksConfigure testMethod=test_java_tool_checks>
[task 2020-11-04T16:01:43.083Z]  0:14.74 
[task 2020-11-04T16:01:43.083Z]  0:14.74     def test_java_tool_checks(self):
[task 2020-11-04T16:01:43.084Z]  0:14.74         # A valid set of tools in a standard location.
[task 2020-11-04T16:01:43.084Z]  0:14.74         java = mozpath.abspath("/usr/bin/java")
[task 2020-11-04T16:01:43.084Z]  0:14.74 
[task 2020-11-04T16:01:43.084Z]  0:14.74         paths = {java: None}
[task 2020-11-04T16:01:43.085Z]  0:14.74 
[task 2020-11-04T16:01:43.087Z]  0:14.74         script = textwrap.dedent(
[task 2020-11-04T16:01:43.087Z]  0:14.74             """\
[task 2020-11-04T16:01:43.087Z]  0:14.74                     @depends('--help')
[task 2020-11-04T16:01:43.087Z]  0:14.74                     def host(_):
[task 2020-11-04T16:01:43.087Z]  0:14.74                         return namespace(os='unknown')
[task 2020-11-04T16:01:43.088Z]  0:14.74                     include('%(topsrcdir)s/build/moz.configure/java.configure')
[task 2020-11-04T16:01:43.088Z]  0:14.74                 """
[task 2020-11-04T16:01:43.088Z]  0:14.74             % {"topsrcdir": topsrcdir}
[task 2020-11-04T16:01:43.088Z]  0:14.74         )
[task 2020-11-04T16:01:43.088Z]  0:14.74 
[task 2020-11-04T16:01:43.089Z]  0:14.74         config, out, status = self.get_result(command=script, extra_paths=paths)
[task 2020-11-04T16:01:43.089Z]  0:14.74 >       self.assertEqual(status, 0)
[task 2020-11-04T16:01:43.089Z]  0:14.74 E       AssertionError: 1 != 0
[task 2020-11-04T16:01:43.090Z]  0:14.74 
[task 2020-11-04T16:01:43.090Z]  0:14.74 python/mozbuild/mozbuild/test/configure/test_checks_configure.py:578: AssertionError
[task 2020-11-04T16:01:43.090Z]  0:14.74 ------------------------------ Captured log call -------------------------------
[task 2020-11-04T16:01:43.090Z]  0:14.74 __init__.py                432 ERROR    Could not find "java" on the $PATH. Please install the Java 1.8 JDK.
[task 2020-11-04T16:01:43.090Z]  0:14.74 =========================== short test summary info ============================```

:mhentges any chance you could take a quick look at this?
Thank you

Flags: needinfo?(mhentges)

For sure, thanks for the report :)

Flags: needinfo?(mhentges)
Assignee: nobody → mhentges
Status: NEW → ASSIGNED

Hmm, it looks like the test didn't use to fail because our test case would tell the configure sandbox "hey, /usr/local/bin/java exists". Then, when the real java-detection code would run, it would use configure's special which() function, which respects the "mock file" configuration.

However, the new Java-detection code is outside of configure (since it's shared with bootstrap). This means that it can't use that custom which() function that respects the inject mock files.

Set release status flags based on info from the regressing bug 1670264

Previously, configure checked for Java binaries using
"configure"-specific "which()" and environment-variable-getter
functions. When bug 1670264 changed Java detection to use logic shared
between "configure" and "bootstrap", more general "which()"
/environment-variable-getter functions were used.

The test used to work because the "configure"-specific functions
respect the mocked-out file system and environment variables.
This patch adjusts the test to add mocks so the more general logic
is redirected to respect the mocked data.

The patch seems to be reviewed.
Mitchell, if there are no other restrictions, could we have this landed? Could you please add the check-in needed tag and the testing tag if so?
Thank you.

Flags: needinfo?(mhentges)

I'm just doing one more try run with reviewer-recommended improvements, then I'll land this 👍

Flags: needinfo?(mhentges)
Pushed by mhentges@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d009f39bc727
Add mocks so Java-detection doesn't hit real file system r=firefox-build-system-reviewers,rstewart
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: