Improve test_pe fixture stability

This commit is contained in:
hakril
2025-02-08 19:44:39 +01:00
parent a93c9b7f11
commit 405616290f
+10 -2
View File
@@ -16,8 +16,16 @@ def pe(request):
pop_proc = request.param
proc = pop_proc()
time.sleep(0.01)
yield proc.peb.modules[2].pe
for i in range(10):
try:
time.sleep(0.1)
yield proc.peb.modules[2].pe
break
except ValueError:
if i == 9:
# Last change failed
raise
continue # PEB.Ldr not ready yet
proc.exit(0)
PE_DOTNET32_DLL_NAME = "test_pe_dotnet32.dll"