From 492d4039a6179eb140015ee6984761300ccd0e10 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 2 Dec 2020 18:00:44 +0100 Subject: [PATCH] test: allow running replication tests in parallel running multiple workers reduces built time from >3s to ~0.6s here. Signed-off-by: Thomas Lamprecht --- test/Makefile | 11 ++++------- test/ReplicationTestEnv.pm | 8 ++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/test/Makefile b/test/Makefile index 478d302f..d383e89f 100644 --- a/test/Makefile +++ b/test/Makefile @@ -10,13 +10,10 @@ check: test-replication test-balloon test-mail test-vzdump test-balloon: ./balloontest.pl -test-replication: - ./replication_test1.pl - ./replication_test2.pl - ./replication_test3.pl - ./replication_test4.pl - ./replication_test5.pl - ./replication_test6.pl +test-replication: replication1.t replication2.t replication3.t replication4.t replication5.t replication6.t + +replication%.t: replication_test%.pl + ./$< test-mail: ./mail_test.pl diff --git a/test/ReplicationTestEnv.pm b/test/ReplicationTestEnv.pm index e92fba18..005e6d54 100755 --- a/test/ReplicationTestEnv.pm +++ b/test/ReplicationTestEnv.pm @@ -68,13 +68,13 @@ my $mocked_ssh_info_to_command = sub { return ['fake_ssh', $info->{name}, @extra_options]; }; -my $statefile = ".mocked_repl_state"; +my $statefile = ".mocked_repl_state.$$"; unlink $statefile; $PVE::ReplicationState::state_path = $statefile; -$PVE::ReplicationState::state_lock = ".mocked_repl_state_lock"; -$PVE::API2::Replication::pvesr_lock_path = ".mocked_pvesr_lock"; -$PVE::GuestHelpers::lockdir = ".mocked_pve-manager_lock"; +$PVE::ReplicationState::state_lock = ".mocked_repl_state_lock.$$"; +$PVE::API2::Replication::pvesr_lock_path = ".mocked_pvesr_lock.$$"; +$PVE::GuestHelpers::lockdir = ".mocked_pve-manager_lock.$$"; if (!mkdir($PVE::GuestHelpers::lockdir) && !$!{EEXIST}) { # If we cannot create the guest helper lockdir we'll loop endlessly, so die -- 2.39.5