| Summary: | devtool setupClass file copying race | ||
|---|---|---|---|
| Product: | [QA/Testing] Functional (self) Testing | Reporter: | Richard Purdie <richard.purdie> |
| Component: | oe-selftest | Assignee: | Tim Orling <tim.orling> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | randy.macleod, ross.burton, tim.orling |
| Version: | unspecified | ||
| Target Milestone: | 3.2 M4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | backport 3.1 AB-INT | ||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
|
Description
Richard Purdie
2020-02-19 20:24:04 UTC
Only seen once so far. *** Bug 13421 has been marked as a duplicate of this bug. *** We've seen this same pattern in 13803, so more than once.
If it is indeed a race condition with .pyc files being used while they are being copied, then the ignore_pattern argument to copytree looks to be the solution [1]:
"""
Another example that uses the ignore_patterns() helper:
from shutil import copytree, ignore_patterns
copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*'))
This will copy everything except .pyc files and files or directories whose name starts with tmp.
"""
[1] https://docs.python.org/3/library/shutil.html#copytree-example
The answers in this SO look promising: https://stackoverflow.com/questions/7842044/filter-directory-when-using-shutil-copytree subunit.RemotedTestCase Tells us the offending code (shutil.copytree) only occurs when running oe-selftest in parallel (-j), e.g. oe-selftest -v -j 8 -r devtool Note this requires python3-testtools and python3-subunit installed on the host (need to double check docs are calling that out). Yes, it's a one-liner solution, but testing it is non-trivial. oe-selftest assumes you have a large /tmp partition (which I do not), so I had to hack a local branch to use my large build partition. Also, as noted in previous comment, the code in question is only exercised in parallel oe-selftest operation. With HIGHLY instrumented code, I have found no failures of the simple one-liner patch (other than the npm test case which is unrelated). I have also not found a smoking gun that proves I fixed it. But it **should** be the right fix. So, submit and move on to the next bug. |