All of lore.kernel.org
 help / color / mirror / Atom feed
* [REPORT] Double deletion of output directory in functional test
@ 2026-01-23 14:37 Aditya Gupta
  2026-01-23 19:45 ` Aditya Gupta
  0 siblings, 1 reply; 4+ messages in thread
From: Aditya Gupta @ 2026-01-23 14:37 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Philippe Mathieu-Daudé, Daniel P. Berrangé,
	Peter Xu, Fabiano Rosas

Hello,

I notice a test failure with ppc64 functional tests, which only occurs when
tests are run in parallel ('make check-functional-ppc64 -j8').

I believe the issue might be with the generic migration testcase. The following
backtrace happens on error:

	Traceback (most recent call last):
	  File "<SRC_DIR>/tests/functional/qemu_test/testcase.py", line 421, in tearDown
	    super().tearDown()
	  File "<SRC_DIR>/tests/functional/qemu_test/testcase.py", line 238, in tearDown
	    shutil.rmtree(self.workdir)
	  File "/usr/lib64/python3.11/shutil.py", line 742, in rmtree
	    onerror(os.lstat, path, sys.exc_info())
	  File "/usr/lib64/python3.11/shutil.py", line 740, in rmtree
	    orig_st = os.lstat(path, dir_fd=dir_fd)
	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	FileNotFoundError: [Errno 2] No such file or directory: '<SRC_DIR>/build/tests/functional/ppc64/test_migration.PpcMigrationTest.test_migration_with_exec/scratch'

The core issue is that during setUp, the `self.workdir` is correctly created,
but during tearDown, the `self.workdir` is somehow already deleted, thus causing
shutil.rmtree to fail with directory doesn't exist.

Since this only occurs with parallel tests, I believe multiple subtests
are trying to remove the same dir ?

I haven't been able to figure exactly where the issue happens. Any ideas ?

Two possible workarounds:
1. `export QEMU_TEST_KEEP_SCRATCH=1`, this causes qemu to skip the shutil.rmtree
2. Have if condition (or try-except) around the shutl.rmtree to skip double
deletion issues.

Thanks,
- Aditya G

QEMU Commit Id: 2339d0a1cfac6ecc667e6e062a593865c1541c35

To reproduce issue:
	./configure
	make check-functional-ppc64 -j8

Log:
	$ make check-functional-ppc64 -j8
	
	>>> LD_LIBRARY_PATH=<SRC_DIR>/build/tests/tcg/plugins:<SRC_DIR>/build/contrib/plugins QEMU_TEST_GDB=/usr/bin/gdb PYTHONPATH=<SRC_DIR>/python:<SRC_DIR>/tests/functional MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MESON_TEST_ITERATION=1 G_TEST_SLOW=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 RUST_BACKTRACE=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 QEMU_BUILD_ROOT=<SRC_DIR>/build QEMU_TEST_QEMU_BINARY=<SRC_DIR>/build/qemu-system-ppc64 MALLOC_PERTURB_=145 QEMU_TEST_QEMU_IMG=<SRC_DIR>/build/qemu-img <SRC_DIR>/build/pyvenv/bin/python3 <SRC_DIR>/tests/functional/ppc64/test_pseries.py
	―――――――――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――――――――――
	stderr:
	Traceback (most recent call last):
	  File "<SRC_DIR>/tests/functional/qemu_test/testcase.py", line 421, in tearDown
	    super().tearDown()
	  File "<SRC_DIR>/tests/functional/qemu_test/testcase.py", line 238, in tearDown
	    shutil.rmtree(self.workdir)
	  File "/usr/lib64/python3.11/shutil.py", line 742, in rmtree
	    onerror(os.lstat, path, sys.exc_info())
	  File "/usr/lib64/python3.11/shutil.py", line 740, in rmtree
	    orig_st = os.lstat(path, dir_fd=dir_fd)
	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	FileNotFoundError: [Errno 2] No such file or directory: '<SRC_DIR>/build/tests/functional/ppc64/test_migration.PpcMigrationTest.test_migration_with_exec/scratch'
	
	Traceback (most recent call last):
	  File "<SRC_DIR>/tests/functional/qemu_test/testcase.py", line 421, in tearDown
	    super().tearDown()
	  File "<SRC_DIR>/tests/functional/qemu_test/testcase.py", line 238, in tearDown
	    shutil.rmtree(self.workdir)
	  File "/usr/lib64/python3.11/shutil.py", line 742, in rmtree
	    onerror(os.lstat, path, sys.exc_info())
	  File "/usr/lib64/python3.11/shutil.py", line 740, in rmtree
	    orig_st = os.lstat(path, dir_fd=dir_fd)
	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	FileNotFoundError: [Errno 2] No such file or directory: '<SRC_DIR>/build/tests/functional/ppc64/test_migration.PpcMigrationTest.test_migration_with_tcp_localhost/scratch'
	
	Traceback (most recent call last):
	  File "<SRC_DIR>/tests/functional/qemu_test/testcase.py", line 421, in tearDown
	    super().tearDown()
	  File "<SRC_DIR>/tests/functional/qemu_test/testcase.py", line 238, in tearDown
	    shutil.rmtree(self.workdir)
	  File "/usr/lib64/python3.11/shutil.py", line 742, in rmtree
	    onerror(os.lstat, path, sys.exc_info())
	  File "/usr/lib64/python3.11/shutil.py", line 740, in rmtree
	    orig_st = os.lstat(path, dir_fd=dir_fd)
	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	FileNotFoundError: [Errno 2] No such file or directory: '<SRC_DIR>/build/tests/functional/ppc64/test_migration.PpcMigrationTest.test_migration_with_unix/scratch'
	
	More information on test_migration.PpcMigrationTest.test_migration_with_exec could be found here:
	 <SRC_DIR>/build/tests/functional/ppc64/test_migration.PpcMigrationTest.test_migration_with_exec/base.log
	 <SRC_DIR>/build/tests/functional/ppc64/test_migration.PpcMigrationTest.test_migration_with_exec/console.log
	More information on test_migration.PpcMigrationTest.test_migration_with_tcp_localhost could be found here:
	 <SRC_DIR>/build/tests/functional/ppc64/test_migration.PpcMigrationTest.test_migration_with_tcp_localhost/base.log
	 <SRC_DIR>/build/tests/functional/ppc64/test_migration.PpcMigrationTest.test_migration_with_tcp_localhost/console.log
	More information on test_migration.PpcMigrationTest.test_migration_with_unix could be found here:
	 <SRC_DIR>/build/tests/functional/ppc64/test_migration.PpcMigrationTest.test_migration_with_unix/base.log
	 <SRC_DIR>/build/tests/functional/ppc64/test_migration.PpcMigrationTest.test_migration_with_unix/console.log
	
	(test program exited with status code 1)
	―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-26 15:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 14:37 [REPORT] Double deletion of output directory in functional test Aditya Gupta
2026-01-23 19:45 ` Aditya Gupta
2026-01-26 15:48   ` Fabiano Rosas
2026-01-26 15:53     ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.