Skip to content

Commit

Permalink
色々情報追加
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Nov 6, 2024
1 parent 553aa03 commit c905b2d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/momo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
class Momo:
def __init__(self, mode="test", port=5000):
self.executable = RELEASE_DIR / "momo"
assert self.executable.exists()
self.mode = mode
self.port = port
self.process = None
Expand All @@ -38,6 +39,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):

def run_app(self):
print(self.executable)

args = [
str(self.executable),
self.mode,
Expand All @@ -57,7 +59,7 @@ def run_app(self):

def start(self):
if not self.executable.exists():
raise FileNotFoundError(f"Momo executable not found: {self.executable}")
raise FileNotFoundError(f"Executable file not found: {self.executable}")

self.thread = threading.Thread(target=self.run_app)
self.thread.start()
Expand Down Expand Up @@ -85,6 +87,6 @@ def stop(self):
print("Momo did not terminate gracefully. Forcing termination.", file=sys.stderr)
self.process.kill()

self.thread.join()
self.thread.join(timeout=5)
self.is_running = False
print("Momo stopped")

0 comments on commit c905b2d

Please sign in to comment.