From 99438fae3fc5293b6b13af9f9a1c9138c2d7bd46 Mon Sep 17 00:00:00 2001 From: bizhiyuan Date: Wed, 6 Sep 2023 01:11:47 +0800 Subject: [PATCH] fix datetime race condition (cherry picked from commit 6c87e398a5f41596fcdb9a9136cdbd48959b1c0a) --- pcs.spec | 6 +++++- tests-fix-datetime-race-condition.patch | 27 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests-fix-datetime-race-condition.patch diff --git a/pcs.spec b/pcs.spec index 7a1f3d1..50ce3bb 100644 --- a/pcs.spec +++ b/pcs.spec @@ -1,6 +1,6 @@ Name: pcs Version: 0.11.2 -Release: 5 +Release: 6 License: GPLv2 and BSD-2-Clause and ASL 2.0 and MIT URL: https://github.com/ClusterLabs/pcs Summary: Pacemaker Configuration System @@ -45,6 +45,7 @@ Patch5: Fix-typing-in-resource_agent-package.patch Patch6: fix-pcs-config-checkpoint-diff-command.patch #https://github.com/ClusterLabs/pcs/pull/522 Patch7: fix-pcs-quorum-device-remove.patch +Patch8: tests-fix-datetime-race-condition.patch # git for patches BuildRequires: git-core @@ -408,6 +409,9 @@ run_all_tests %license pyagentx_LICENSE.txt %changelog +* Wed Sep 06 2023 bizhiyuan - 0.11.2-6 +- fix datetime race condition + * Tue Sep 05 2023 zouzhimin - 0.11.2-5 - Fix pcs quorum device remove diff --git a/tests-fix-datetime-race-condition.patch b/tests-fix-datetime-race-condition.patch new file mode 100644 index 0000000..ad14a94 --- /dev/null +++ b/tests-fix-datetime-race-condition.patch @@ -0,0 +1,27 @@ +From b8e186f82cafea79e0ebf9beb1627ce0c62a8b16 Mon Sep 17 00:00:00 2001 +From: bizhiyuan +Date: Wed, 6 Sep 2023 01:02:45 +0800 +Subject: [PATCH] tests: fix datetime race condition + +--- + pcs_test/tier1/legacy/test_constraints.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/pcs_test/tier1/legacy/test_constraints.py b/pcs_test/tier1/legacy/test_constraints.py +index 963fbe8..90c8d7f 100644 +--- a/pcs_test/tier1/legacy/test_constraints.py ++++ b/pcs_test/tier1/legacy/test_constraints.py +@@ -4709,7 +4709,9 @@ class LocationAdd(ConstraintEffect): + + @skip_unless_crm_rule() + class ExpiredConstraints(ConstraintBaseTest): +- _tomorrow = (datetime.date.today() + datetime.timedelta(days=1)).strftime( ++ # Setting tomorrow to the day after tomorrow in case the tests run close to ++ # midnight. ++ _tomorrow = (datetime.date.today() + datetime.timedelta(days=2)).strftime( + "%Y-%m-%d" + ) + +-- +2.27.0 + -- Gitee