Skip to content

Commit

Permalink
Tweaks for running UDK.com
Browse files Browse the repository at this point in the history
  • Loading branch information
tuokri committed Nov 13, 2023
1 parent 5ea70ec commit 649dc2e
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions tests/UDKTests/setup_udk_build_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from typing import IO

import httpx
import psutil
import py7zr
import tqdm
import watchdog.events
Expand Down Expand Up @@ -262,8 +261,9 @@ async def run_udk_build(
proc = await asyncio.create_subprocess_shell(
cmd=f'powershell.exe Start-Process -NoNewWindow -FilePath "{udk_exe}" '
f'-ArgumentList "make","-useunpublished","-UNATTENDED","LOG=Launch.log",'
f'"-VERBOSE","-NOPAUSE","-FORCELOGFLUSH","-DEBUG",'
f'"-AUTO"',
f'"-NOPAUSE","-FORCELOGFLUSH","-AUTO"',
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.STDOUT,
)
else:
proc = await asyncio.create_subprocess_exec(
Expand Down Expand Up @@ -320,8 +320,9 @@ async def run_udk_server(
test_proc = await asyncio.create_subprocess_shell(
cmd=f'powershell.exe Start-Process -NoNewWindow -FilePath "{udk_exe}" '
f'-ArgumentList "server","{udk_args}","-UNATTENDED","LOG=Launch.log",'
f'"-VERBOSE","-NOPAUSE","-FORCELOGFLUSH","-DEBUG",'
f'"-AUTO"',
f'"-NOPAUSE","-FORCELOGFLUSH","-AUTO"',
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.STDOUT,
)
else:
test_proc = await asyncio.create_subprocess_exec(
Expand Down Expand Up @@ -357,15 +358,15 @@ async def run_udk_server(
return test_ec


def print_udk_processes(event: threading.Event):
while not event.is_set():
sleep_time = 0.01
for proc in psutil.process_iter():
if "udk" in proc.name().lower():
print(f"\t{'#' * 4} {proc}")
sleep_time = 0.5

time.sleep(sleep_time)
# def print_udk_processes(event: threading.Event):
# while not event.is_set():
# sleep_time = 0.01
# for proc in psutil.process_iter():
# if "udk" in proc.name().lower():
# print(f"\t{'#' * 4} {proc}")
# sleep_time = 0.5
#
# time.sleep(sleep_time)


async def main():
Expand Down Expand Up @@ -527,11 +528,11 @@ async def main():
testing_event = threading.Event()
poker_event = threading.Event()

udk_print_spam_thread = threading.Thread(
target=print_udk_processes,
args=(poker_event,),
)
udk_print_spam_thread.start()
# udk_print_spam_thread = threading.Thread(
# target=print_udk_processes,
# args=(poker_event,),
# )
# udk_print_spam_thread.start()

obs = watchdog.observers.Observer()
watcher = LogWatcher(building_event, testing_event, log_file)
Expand Down Expand Up @@ -603,7 +604,7 @@ async def main():
if ec != 0:
raise RuntimeError(f"UDK.exe error (sum of all exit codes): {ec}")

udk_print_spam_thread.join(timeout=5)
# udk_print_spam_thread.join(timeout=5)

print(f"finished with {len(watcher.warnings)} warnings")
print(f"finished with {len(watcher.errors)} errors")
Expand Down

0 comments on commit 649dc2e

Please sign in to comment.