Intermittent race condition with sys.argv when running tests.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Landscape Client |
Fix Committed
|
Undecided
|
Eric Snow |
Bug Description
A number of tests patch out sys.argv or other similar shared global resources. When the tests run multi-threaded (e.g. "TRIAL_ARGS=-j4 make ci-check" in tarmac), under certain load conditions a race on these resources causes erroneous tests failures.
For example:
* https:/
Either the tests should not be run multi-threaded or monkeypatching should be greatly reduced in the tests.
To reproduce:
[these steps aren't quite right yet]
1. simulate the load by adding time.sleep(10) immediately after sys.argv is patched out:
+ landscape/
+ landscape/
2. run the tests multi-threaded:
+ TRIAL_ARGS=-j4 trial landscape.
Related branches
- 🤖 Landscape Builder: Approve (test results)
- Free Ekanayaka (community): Approve
- Simon Poirier (community): Approve
-
Diff: 1291 lines (+304/-257)20 files modifiedlandscape/deployment.py (+16/-0)
landscape/lib/bpickle.py (+0/-1)
landscape/lib/tests/test_process.py (+2/-1)
landscape/manager/aptsources.py (+1/-1)
landscape/manager/packagemanager.py (+4/-5)
landscape/manager/tests/test_aptsources.py (+2/-2)
landscape/manager/tests/test_packagemanager.py (+40/-38)
landscape/monitor/packagemonitor.py (+4/-1)
landscape/monitor/tests/test_packagemonitor.py (+20/-34)
landscape/monitor/tests/test_processorinfo.py (+3/-3)
landscape/package/changer.py (+12/-10)
landscape/package/releaseupgrader.py (+7/-11)
landscape/package/reporter.py (+4/-4)
landscape/package/tests/test_changer.py (+35/-40)
landscape/package/tests/test_releaseupgrader.py (+15/-23)
landscape/package/tests/test_reporter.py (+13/-14)
landscape/tests/helpers.py (+12/-0)
landscape/tests/test_deployment.py (+37/-1)
landscape/tests/test_watchdog.py (+73/-66)
landscape/watchdog.py (+4/-2)
description: | updated |
Changed in landscape-client: | |
assignee: | nobody → Eric Snow (ericsnowcurrently) |
status: | New → In Progress |
Changed in landscape-client: | |
status: | In Progress → Fix Committed |