test: give the DLL loader tests time to start a process

This commit is contained in:
mirkobrombin committed 2026-10-26 13:18:37 +00:00
1 parent 8b8c13b727
commit 49e2375d58
2 files changed
+5 -2

No files matched your search

+3 -1
View File
@@ -50,7 +50,9 @@ int main(int argc, char **argv)
}
return bytes;
};
const auto result = raven::run_native_process(modules, entry, argv[1], std::chrono::milliseconds(500), source);
// Process startup alone can take most of a second on a loaded host: only the looping DLLs need a short limit.
const auto timeout = std::chrono::milliseconds(selected.ends_with("loop") ? 2000 : 10000);
const auto result = raven::run_native_process(modules, entry, argv[1], timeout, source);
const auto address = modules.resolve({"client.exe", "entered", 0, false, 0}) - entry.loaded.base();
check(address < entry.loaded.data().size(), "fixture state is outside image");
const auto entered = entry.loaded.data()[static_cast<size_t>(address)];
+2 -1
View File
@@ -163,7 +163,8 @@ int main(int argc, char **argv)
const auto address = modules.resolve({"client.exe", "exit_requested", 0, false, 0});
entry->loaded.data()[address - entry->loaded.base()] = 1;
}
const auto timeout = std::chrono::milliseconds(extra == "loop.dll" ? 300 : 10000);
// The looping DLL must still be reached after base.dll and dependent.dll attach, which can take most of a second on a loaded host.
const auto timeout = std::chrono::milliseconds(extra == "loop.dll" ? 2000 : 10000);
if (extra == "reject.dll") {
bool rejected = false;
try { raven::run_native_process(modules, *entry, argv[1], timeout); }