Repository navigation
tests: Fix race condition in test_set_bitmap_location #1223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -478,7 +478,7 @@ def test_name_node_bijection(self): | |
|
|
||
|
|
||
| class MDTestSetBitmapLocation(MDTestCase): | ||
| @tag_test(TestTags.SLOW, TestTags.UNSTABLE) | ||
| @tag_test(TestTags.SLOW) | ||
| def test_set_bitmap_location(self): | ||
| """Verify we can change bitmap location for an existing MD array""" | ||
|
|
||
|
|
@@ -508,8 +508,9 @@ def test_set_bitmap_location(self): | |
| loc = BlockDev.md_get_bitmap_location("bd_test_md") | ||
| self.assertEqual(loc, "none") | ||
|
|
||
| succ = BlockDev.md_set_bitmap_location("bd_test_md", "internal") | ||
| self.assertTrue(succ) | ||
| with wait_for_action("resync"): | ||
| succ = BlockDev.md_set_bitmap_location("bd_test_md", "internal") | ||
| self.assertTrue(succ) | ||
|
Comment on lines
+511
to
+513
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| loc = BlockDev.md_get_bitmap_location("bd_test_md") | ||
| self.assertIn(loc, ("+8", "+2")) | ||
|
|
@@ -523,8 +524,9 @@ def test_set_bitmap_location(self): | |
| node = BlockDev.md_node_from_name("bd_test_md") | ||
| self.assertIsNotNone(node) | ||
|
|
||
| succ = BlockDev.md_set_bitmap_location(node, "internal") | ||
| self.assertTrue(succ) | ||
| with wait_for_action("resync"): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| succ = BlockDev.md_set_bitmap_location(node, "internal") | ||
| self.assertTrue(succ) | ||
|
|
||
| succ = BlockDev.md_set_bitmap_location("/dev/%s" % node, "none") | ||
| self.assertTrue(succ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: storaged-project/libblockdev
Length of output: 5025
Script executed:
Repository: storaged-project/libblockdev
Length of output: 20191
Script executed:
Repository: storaged-project/libblockdev
Length of output: 15948
Web query:
Linux kernel documentation /proc/mdstat multiple arrays resync example statusResult:
Web query:
site:kernel.org /proc/mdstat "resync =" md0 md1Result:
Web query:
Linux kernel drivers/md/md.c mdstat_show status resync proc mdstat seq_printf "resync" md_seq_showResult:
Web query:
"status_resync" "resync" "seq_printf" linux md.cResult:
Limit the wait to the test array.
If another array starts a long resync after the creation wait, this wait can block the suite until that resync finishes, even after
bd_test_mdis ready. Make the helper check the test array’s status instead of all of/proc/mdstat.