[Lldb-commits] [lldb] 7b9435b - [lldb][test] Increase polling frequency in ProcessAttach (#201532)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Jun 5 00:57:52 PDT 2026
Author: Raphael Isemann
Date: 2026-06-05T08:57:48+01:00
New Revision: 7b9435b0ed1db10c81167a5f415ae14b4b3e0565
URL: https://github.com/llvm/llvm-project/commit/7b9435b0ed1db10c81167a5f415ae14b4b3e0565
DIFF: https://github.com/llvm/llvm-project/commit/7b9435b0ed1db10c81167a5f415ae14b4b3e0565.diff
LOG: [lldb][test] Increase polling frequency in ProcessAttach (#201532)
The test_attach_to_process_by_id_correct_executable_offset subtest
requires us to hit a breakpoint in an attached process. For this we
implement a loop that hits the breakpoint location every 2 seconds.
This patch increases the rate at which we hit this breakpoint to 50ms.
The reason is that a 2s interval means that this test is waiting on any
fast system for nearly 2 seconds on the first breakpoint hit. With a
50ms interval this subtest passed immediately.
Added:
Modified:
lldb/test/API/commands/process/attach/main.cpp
Removed:
################################################################################
diff --git a/lldb/test/API/commands/process/attach/main.cpp b/lldb/test/API/commands/process/attach/main.cpp
index 034e80ed5f2b3..4d499ab3a7f91 100644
--- a/lldb/test/API/commands/process/attach/main.cpp
+++ b/lldb/test/API/commands/process/attach/main.cpp
@@ -1,21 +1,17 @@
#include "attach.h"
#include <chrono>
-#include <cstdio>
#include <thread>
volatile int g_val = 12345;
int main(int argc, char const *argv[]) {
- int temp;
- lldb_enable_attach();
+ lldb_enable_attach();
- // Waiting to be attached by the debugger.
- temp = 0;
+ // This provides a breakpoint we hit every 50ms that the tests can hit.
+ std::chrono::milliseconds poll_time(50);
+ unsigned total_wait_in_sec = 60;
+ unsigned total_wait_time = total_wait_in_sec * (1000 / poll_time.count());
- while (temp < 30) {
- std::this_thread::sleep_for(std::chrono::seconds(2)); // Waiting to be attached...
- temp++;
- }
-
- printf("Exiting now\n");
+ for (unsigned wait = 0; wait < total_wait_time; wait++)
+ std::this_thread::sleep_for(poll_time); // Waiting to be attached...
}
More information about the lldb-commits
mailing list