allow to rerun failed exp
This commit is contained in:
parent
bb4b93167e
commit
d9ff145b99
1 changed files with 17 additions and 2 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import json
|
||||||
|
import shutil
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import threading
|
import threading
|
||||||
|
|
@ -240,8 +242,21 @@ def worker(emu: str, apklist: list[str], out_folder: Path, script: Path):
|
||||||
apk = apklist.pop()
|
apk = apklist.pop()
|
||||||
folder_name = apk.split("/")[-1].removesuffix(".apk")
|
folder_name = apk.split("/")[-1].removesuffix(".apk")
|
||||||
folder = out_folder / folder_name
|
folder = out_folder / folder_name
|
||||||
if folder.exists():
|
if folder.exists() and (folder / "data.json").exists():
|
||||||
continue
|
has_error = False
|
||||||
|
with (folder / "data.json").open() as fp:
|
||||||
|
data = json.load(fp)
|
||||||
|
if "error" in data:
|
||||||
|
has_error = True
|
||||||
|
if (folder / "TIMEOUT").exists():
|
||||||
|
has_error = True
|
||||||
|
if has_error:
|
||||||
|
print(
|
||||||
|
f"Previous result for {apk=} found but with error of timeout, remove old result and rerun it"
|
||||||
|
)
|
||||||
|
shutil.rmtree(str(folder))
|
||||||
|
else:
|
||||||
|
continue
|
||||||
folder.mkdir(parents=True)
|
folder.mkdir(parents=True)
|
||||||
|
|
||||||
with (
|
with (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue