Skip to content

Commit c726566

Browse files
committed
Add "slow" as a new non-default marker
The "slow" marker designates tests that may take a long time and are designed to catch rare issues that may need large datasets or multiple repetitions to be reproduced. Add the following tests to reproduce the following rare issues: * test_migrate_repeat: Windows migration issues associated with the XenVbd driver * test_create_and_destroy_sr_repeat: NFS deadlock issue Add a new `multi/slow` VM list for this purpose. Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
1 parent d3278dd commit c726566

6 files changed

Lines changed: 42 additions & 2 deletions

File tree

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
# pytest hooks
5050

51-
NONDEFAULT_MARKERS = ["reboot", "flaky"]
51+
NONDEFAULT_MARKERS = ["reboot", "flaky", "slow"]
5252

5353
def pytest_addoption(parser: pytest.Parser):
5454
parser.addoption(

jobs.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,22 @@
468468
"--vm[]": "multi/limits",
469469
},
470470
"paths": ["tests/limits"],
471-
}
471+
},
472+
"slow": {
473+
"description": "tests that may take a long time",
474+
"requirements": [
475+
"Will vary depending on the tests included.",
476+
"Use the collect command to get the list of tests "
477+
+ "and check the requirements written at the top of the test files.",
478+
],
479+
"nb_pools": 1,
480+
"params": {
481+
"--enable-slow": True,
482+
"--vm[]": "multi/slow",
483+
},
484+
"paths": ["tests"],
485+
"markers": "slow",
486+
},
472487
}
473488

474489
# List used by the 'check' action: tests listed here will not raise a check error

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ markers =
3737
flaky: flaky tests. Usually pass, but sometimes fail unexpectedly.
3838
complex_prerequisites: tests whose prerequisites are complex and may require special attention.
3939
quicktest: runs `quicktest`.
40+
slow: tests that may take a long time, designed to catch rare issues.
4041
log_level = debug
4142
log_cli = 1
4243
log_cli_level = info

tests/misc/test_vm_basic_operations.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ def test_suspend(self, running_vm: VM):
1919
vm.resume()
2020
vm.wait_for_vm_running_and_ssh_up()
2121

22+
@pytest.mark.slow
23+
@pytest.mark.parametrize("attempt", range(100))
24+
def test_migrate_repeat(self, running_vm: VM, attempt: int):
25+
"""
26+
Perform a "fast" stress test of the suspend mechanism by repeatedly migrating onto the same host.
27+
28+
We don't use the usual suspend call, but use local migrations to avoid hitting the disk and/or network.
29+
"""
30+
vm = running_vm
31+
residence = vm.get_residence_host()
32+
vm.migrate(residence)
33+
vm.wait_for_vm_running_and_ssh_up()
34+
2235
def test_snapshot(self, running_vm: VM):
2336
vm = running_vm
2437
vm.test_snapshot_on_running_vm()

tests/storage/iso/test_nfs_iso_sr.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ def test_create_and_destroy_sr(self, host, nfs_iso_device_config):
3535
sr = host.sr_create('iso', "ISO-NFS-SR-test", nfs_iso_device_config, shared=True, verify=True)
3636
sr.forget()
3737

38+
@pytest.mark.slow
39+
@pytest.mark.parametrize("attempt", range(100))
40+
def test_create_and_destroy_sr_repeat(self, host, nfs_iso_device_config, attempt: int):
41+
"""Look for potential issues in the NFS subsystem by stress testing the connection and disconnection code."""
42+
self.test_create_and_destroy_sr(host, nfs_iso_device_config)
43+
3844

3945
@pytest.mark.small_vm
4046
@pytest.mark.usefixtures("nfs_iso_sr")

vm_data.py-dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ VMS["multi"]["limits"] = [vm for vm in [
6565
VMS["single"]["small_vm_windows"],
6666
] if vm]
6767

68+
VMS["multi"]["slow"] = [vm for vm in [
69+
VMS["single"]["small_vm"],
70+
VMS["single"]["small_vm_windows"],
71+
] if vm]
72+
6873
# Example of use for a common XVA_LOCATION
6974
#
7075
# XVA_LOCATION="http://somewhere/"

0 commit comments

Comments
 (0)