From 4ae633b012210452b68dc20238fe4edd41d2635b Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 28 Jan 2025 16:28:35 +0100 Subject: tests/functional: Add a decorator for skipping long running tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some tests have a very long runtime and might run into timeout issues e.g. when QEMU has been compiled with --enable-debug. Add a decorator for marking them more easily. Rename the corresponding environment variable to be more in sync with the other QEMU_TEST_ALLOW_* switches that we already have, and add a paragraph about it in the documentation. Reviewed-by: Daniel P. Berrangé Message-ID: <20250128152839.184599-2-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/functional/qemu_test/decorators.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/functional/qemu_test/decorators.py') diff --git a/tests/functional/qemu_test/decorators.py b/tests/functional/qemu_test/decorators.py index 3d9c02fd59..1651eb739a 100644 --- a/tests/functional/qemu_test/decorators.py +++ b/tests/functional/qemu_test/decorators.py @@ -86,6 +86,20 @@ def skipBigDataTest(): return skipUnless(os.getenv('QEMU_TEST_ALLOW_LARGE_STORAGE'), 'Test requires large host storage space') +''' +Decorator to skip execution of tests which have a really long +runtime (and might e.g. time out if QEMU has been compiled with +debugging enabled) unless the $QEMU_TEST_ALLOW_SLOW +environment variable is set + +Example: + + @skipSlowTest() +''' +def skipSlowTest(): + return skipUnless(os.getenv('QEMU_TEST_ALLOW_SLOW'), + 'Test has a very long runtime and might time out') + ''' Decorator to skip execution of a test if the list of python imports is not available. -- cgit 1.4.1