Unittests have concurrency issues when using fake_notifier.NOTIFICATIONS global variable

Bug #1466112 reported by Alex Meade
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned

Bug Description

cinder/tests/unit/fake_notifier.py has a global list of notifications (NOTIFICAITONS) that is referenced by many unittests. When two tests the rely on this run at the same time, there are unexpected results.

One example is cinder/tests/unit/test_volume.py where many tests assert no notifications have been triggered but some other test running at the same time causes one to be triggered.

We should not be mutating global fakes and instead mock out the notifier within the test on the specific object we are testing.

I can reliably reproduce an example of this issue on master by running:
./run_tests.sh test_create_delete_cgsnapshot\|test_backup

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.