Intermittent race condition with sys.argv when running tests.

Bug #1677630 reported by Eric Snow
6
This bug affects 1 person
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://ci.lscape.net/job/tarmac-xenial-lander/379/console

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/tests/test_watchdog.py (DaemonTest.test_find_executable_works)
   + landscape/package/tests/test_changer.py (AptPackageChangerTest.test_find_changer_command)
 2. run the tests multi-threaded:
   + TRIAL_ARGS=-j4 trial landscape.tests.test_watchdog.DaemonTest.test_find_executable_works landscape.package.tests.test_changer.AptPackageChangerTest.test_find_changer_command

Related branches

description: updated
Changed in landscape-client:
assignee: nobody → Eric Snow (ericsnowcurrently)
status: New → In Progress
Changed in landscape-client:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.