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