diff --git a/tests/dragonfly/instance.py b/tests/dragonfly/instance.py index 800803c88..eef422042 100644 --- a/tests/dragonfly/instance.py +++ b/tests/dragonfly/instance.py @@ -5,6 +5,7 @@ import aiohttp import logging from dataclasses import dataclass from typing import Dict, Optional, List, Union +import os import re import psutil import itertools @@ -162,6 +163,15 @@ class DflyInstance: if proc is None: return + # if we have log files, it means that we started a process. + # if it died before we could stop it, we should raise an exception + if self.log_files: + exitcode = proc.poll() + if exitcode is not None: + if exitcode != 0: + raise Exception(f"Process exited with code {exitcode}") + return + logging.debug(f"Stopping instance on {self._port}") try: if kill: @@ -193,9 +203,11 @@ class DflyInstance: self._port = None all_args = self.format_args(self.args) - logging.debug(f"Starting instance with arguments {all_args} from {self.params.path}") + arg_str = " ".join(all_args) + bin_path = os.path.realpath(self.params.path) + logging.debug(f"Starting {bin_path} with arguments: {arg_str}") - run_cmd = [self.params.path, *all_args] + run_cmd = [bin_path, *all_args] if self.params.gdb: run_cmd = ["gdb", "--ex", "r", "--args"] + run_cmd @@ -319,7 +331,7 @@ class DflyInstanceFactory: args = {**self.args, **kwargs} args.setdefault("dbfilename", "") vmod = "dragonfly_connection=1,accept_server=1,listener_interface=1,main_service=1,rdb_save=1,replica=1" - # args.setdefault("vmodule", vmod) + args.setdefault("vmodule", vmod) for k, v in args.items(): args[k] = v.format(**self.params.env) if isinstance(v, str) else v