Bug 284086
| Summary: | [ews][autoinstall] ModuleNotFoundError: No module named 'mock' | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sam Sneddon [:gsnedders] <gsnedders> |
| Component: | Tools / Tests | Assignee: | Sam Sneddon [:gsnedders] <gsnedders> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | jbedard, ryanhaddad, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Sam Sneddon [:gsnedders]
See, e.g., https://ews-build.webkit.org/#/builders/20/builds/72486, with the show-identifier step:
```
python3 Tools/Scripts/git-webkit find 174fb79a43803442ff7d96e99c87eecd853706d6
in dir /Volumes/Data/worker/JSC-Tests-EWS/build (timeout 300 secs)
watching logfiles {}
argv: [b'python3', b'Tools/Scripts/git-webkit', b'find', b'174fb79a43803442ff7d96e99c87eecd853706d6']
using PTY: False
Traceback (most recent call last):
File "/Volumes/Data/worker/JSC-Tests-EWS/build/Tools/Scripts/git-webkit", line 63, in <module>
sys.exit(program.main(
File "/Volumes/Data/worker/JSC-Tests-EWS/build/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/__init__.py", line 154, in main
repository = local.Scm.from_path(
File "/Volumes/Data/worker/JSC-Tests-EWS/build/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/scm.py", line 45, in from_path
if local.Git.is_checkout(path):
File "/Volumes/Data/worker/JSC-Tests-EWS/build/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py", line 338, in is_checkout
return run([cls.executable(), 'rev-parse', '--show-toplevel'], cwd=path, capture_output=True).returncode == 0
File "/Volumes/Data/worker/JSC-Tests-EWS/build/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/subprocess_utils.py", line 40, in run
with Timeout.DisableAlarm():
File "/Volumes/Data/worker/JSC-Tests-EWS/build/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/timeout.py", line 62, in __init__
from mock import patch
ModuleNotFoundError: No module named 'mock'
program finished with exit code 1
elapsedTime=0.478130
```
This isn't actually related to my change, because e.g., https://ews-build.webkit.org/#/builders/20/builds/72413 also hit this earlier.
On the bot:
```
buildbot@ews251 ~ % ls -Tlh /Volumes/Data/worker/JSC-Tests-EWS/build/Tools/Scripts/libraries/autoinstalled/python-3-x86_64 | grep -E 'mock|manifest'
-rw-r--r-- 1 buildbot admin 1.2K Oct 17 12:15:25 2024 manifest.json
-rw-r--r-- 1 buildbot admin 70K Oct 17 12:15:25 2024 mock-4.tar.gz
drwxr-xr-x 7 buildbot admin 224B Oct 16 14:33:37 2024 mock-5.1.0.dist-info
```
And the manifest.json contains:
```
"mock": {
"index": "pypi.org",
"version": "5.1"
},
```
So somehow we've ended up in a broken state where mock wasn't installed properly, and have been in this state for months seemingly?
There's nothing to indicate how we've ended up with the mock-5.1.0.dist-info (presumably from the mock==5.1.0 wheel being installed) but not the other files.
https://ews-build.webkit.org/#/builders/20/builds/65503 is right around Oct 17 12:15:25 2024, and is a PR on safari-7618-branch (technically a branch off of that, but that's close enough), which seems like a significant jump backwards from main.
My best guess as to what happened here is the install of mock==4 failed, but we don't actually change the manifest until the very end after installation has succeeded — which provides ample opportunity for things to get out of sync.
I don't know what the right fix is here, probably to remove any instance of package X from the manifest just before we start installing a new version, or to do that when we've failed to install. Probably one of the two?
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Sam Sneddon [:gsnedders]
Pull request: https://github.com/WebKit/WebKit/pull/37474
Radar WebKit Bug Importer
<rdar://problem/140989986>
EWS
Committed 287426@main (881ba2ce3758): <https://commits.webkit.org/287426@main>
Reviewed commits have been landed. Closing PR #37474 and removing active labels.
EWS
Committed 283286.568@safari-7620-branch (0fd9aaf87eef): <https://commits.webkit.org/283286.568@safari-7620-branch>
Reviewed commits have been landed. Closing PR #2379 and removing active labels.