[Lldb-commits] [lldb] [lldb][tests] Fix FS timing issue in `TestRerunAndExprDylib`. (PR #205116)
Ingo Müller via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 22 11:57:04 PDT 2026
https://github.com/ingomueller-net updated https://github.com/llvm/llvm-project/pull/205116
>From 59bb8a0972251d28d7416ca32a4616216d013b7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20M=C3=BCller?= <ingomueller at google.com>
Date: Mon, 22 Jun 2026 16:44:15 +0200
Subject: [PATCH] [lldb][tests] Fix FS timing issue in `TestRerunAndExprDylib`.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This PR fixes a timing issue that made `TestRerunAndExprDylib` fail with
a small probability. The test rebuilds a library; however, the build and
the re-build may fall into the same timestamp if the underlying
filesystem only has second granularity such that the rebuild isn't
actually triggered. If that happens, the test fails.
The fix consists in artifically aging the artifacts from the first
build, i.e., setting their timestamps 10 seconds into the past.
This issue exists for at least six months, possible since the tests
exists; I was not able to test older versions. However, we have recently
seen frequent failures, probably due to some change in our underlying
testing infrastructure.
Signed-off-by: Ingo Müller <ingomueller at google.com>
---
.../rerun_and_expr_dylib/TestRerunAndExprDylib.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lldb/test/API/functionalities/rerun_and_expr_dylib/TestRerunAndExprDylib.py b/lldb/test/API/functionalities/rerun_and_expr_dylib/TestRerunAndExprDylib.py
index af413642632b9..e753674ce9144 100644
--- a/lldb/test/API/functionalities/rerun_and_expr_dylib/TestRerunAndExprDylib.py
+++ b/lldb/test/API/functionalities/rerun_and_expr_dylib/TestRerunAndExprDylib.py
@@ -4,6 +4,9 @@
TypeSystems tied to that process.
"""
+import os
+import time
+
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@@ -72,6 +75,13 @@ def test(self):
}
)
+ # Age the library file to 10 seconds in the past so that the rebuilt
+ # library is guaranteed to have a newer modification time on filesystems
+ # with 1s resolution.
+ fpath = self.getBuildArtifact(FULL_DYLIB_NAME)
+ old_mtime = time.time() - 10
+ os.utime(fpath, (old_mtime, old_mtime))
+
exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
target.BreakpointCreateBySourceRegex("dlclose", lldb.SBFileSpec("main.cpp"))
More information about the lldb-commits
mailing list