From dd68065d3478f7c85c9a0b9d41b59891510bbc78 Mon Sep 17 00:00:00 2001 From: Matej Ferencevic Date: Sun, 8 Dec 2019 11:35:50 +0100 Subject: [PATCH] Remove leftover config files Summary: Don't use flag files for specifying flag values in tests. Instead, all necessary flags are explicitly defined in each of the tests. Reviewers: teon.banek Reviewed By: teon.banek Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2588 --- config/benchmarking.conf | 19 ------------------- config/testing.conf | 9 --------- tests/macro_benchmark/databases.py | 9 ++++----- tests/macro_benchmark/long_running_suite.py | 6 +----- tests/macro_benchmark/query_suite.py | 15 +++------------ tools/memory_usage | 5 +---- tools/snapshot_recovery_speed | 13 ++++++------- 7 files changed, 15 insertions(+), 61 deletions(-) delete mode 100644 config/benchmarking.conf delete mode 100644 config/testing.conf diff --git a/config/benchmarking.conf b/config/benchmarking.conf deleted file mode 100644 index 37dc11a57..000000000 --- a/config/benchmarking.conf +++ /dev/null @@ -1,19 +0,0 @@ -# MEMGRAPH DEFAULT BENCHMARKING CONFIG - -# NOTE: all paths are relative to the run folder -# (where the executable is run) - -# no properties on edges ---storage-properties-on-edges=false - -# no durability ---storage-snapshot-on-exit=false ---storage-snapshot-interval-sec=0 ---storage-wal-enabled=false ---storage-recover-on-startup=false - -# no query execution time limit ---query-execution-timeout-sec=0 - -# number of workers ---num-workers=1 diff --git a/config/testing.conf b/config/testing.conf deleted file mode 100644 index 942cd68d8..000000000 --- a/config/testing.conf +++ /dev/null @@ -1,9 +0,0 @@ -# MEMGRAPH DEFAULT TESTING CONFIG - -# NOTE: all paths are relative to the run folder -# (where the executable is run) - -# no durability ---durability-enabled=false ---snapshot-on-exit=false ---db-recover-on-startup=false diff --git a/tests/macro_benchmark/databases.py b/tests/macro_benchmark/databases.py index c9ca30329..250d2c27f 100644 --- a/tests/macro_benchmark/databases.py +++ b/tests/macro_benchmark/databases.py @@ -25,7 +25,7 @@ class Memgraph: """ Knows how to start and stop memgraph. """ - def __init__(self, args, config, num_workers): + def __init__(self, args, num_workers): self.log = logging.getLogger("MemgraphRunner") argp = ArgumentParser("MemgraphArgumentParser") argp.add_argument("--runner-bin", @@ -37,7 +37,6 @@ class Memgraph: argp.add_argument("--storage-recover-on-startup", action="store_true") self.log.info("Initializing Runner with arguments %r", args) self.args, _ = argp.parse_known_args(args) - self.config = config self.num_workers = num_workers self.database_bin = jail.get_process() self.name = "memgraph" @@ -45,8 +44,8 @@ class Memgraph: def start(self): self.log.info("start") - env = {"MEMGRAPH_CONFIG": self.config} - database_args = ["--port", self.args.port] + database_args = ["--port", self.args.port, + "--query-execution-timeout-sec", "0"] if self.num_workers: database_args += ["--num_workers", str(self.num_workers)] if self.args.data_directory: @@ -65,7 +64,7 @@ class Memgraph: runner_bin = get_absolute_path("memgraph", "build_release") # start memgraph - self.database_bin.run(runner_bin, database_args, env=env, timeout=600) + self.database_bin.run(runner_bin, database_args, timeout=600) wait_for_server(self.args.port) def stop(self): diff --git a/tests/macro_benchmark/long_running_suite.py b/tests/macro_benchmark/long_running_suite.py index 1d0e7c09e..65e52f493 100644 --- a/tests/macro_benchmark/long_running_suite.py +++ b/tests/macro_benchmark/long_running_suite.py @@ -90,9 +90,6 @@ class MemgraphRunner(_LongRunningRunner): """ def __init__(self, args): argp = ArgumentParser("MemgraphRunnerArgumentParser") - argp.add_argument("--runner-config", default=get_absolute_path( - "benchmarking.conf", "config"), - help="Path to memgraph config") argp.add_argument("--num-database-workers", type=int, default=8, help="Number of workers") argp.add_argument("--num-client-workers", type=int, default=24, @@ -105,8 +102,7 @@ class MemgraphRunner(_LongRunningRunner): "--num-database-workers is obligatory flag on apollo" assert not APOLLO or self.args.num_client_workers, \ "--num-client-workers is obligatory flag on apollo" - database = Memgraph(remaining_args, self.args.runner_config, - self.args.num_database_workers) + database = Memgraph(remaining_args, self.args.num_database_workers) super(MemgraphRunner, self).__init__( remaining_args, database, self.args.num_client_workers, self.args.workload) diff --git a/tests/macro_benchmark/query_suite.py b/tests/macro_benchmark/query_suite.py index 4b9bd6026..c9d69f4e3 100644 --- a/tests/macro_benchmark/query_suite.py +++ b/tests/macro_benchmark/query_suite.py @@ -211,13 +211,8 @@ class MemgraphRunner(_QueryRunner): Configures memgraph database for QuerySuite execution. """ def __init__(self, args): - argp = ArgumentParser("MemgraphRunnerArgumentParser") - argp.add_argument("--runner-config", default=get_absolute_path( - "benchmarking.conf", "config"), - help="Path to memgraph config") - self.args, remaining_args = argp.parse_known_args(args) - database = Memgraph(remaining_args, self.args.runner_config, 1) - super(MemgraphRunner, self).__init__(remaining_args, database, 1) + database = Memgraph(args, 1) + super(MemgraphRunner, self).__init__(args, database, 1) class NeoRunner(_QueryRunner): @@ -259,9 +254,6 @@ class MemgraphParallelRunner(_QueryRunner): """ def __init__(self, args): argp = ArgumentParser("MemgraphRunnerArgumentParser") - argp.add_argument("--runner-config", default=get_absolute_path( - "benchmarking.conf", "config"), - help="Path to memgraph config") argp.add_argument("--num-database-workers", type=int, default=8, help="Number of workers") argp.add_argument("--num-client-workers", type=int, default=24, @@ -271,7 +263,6 @@ class MemgraphParallelRunner(_QueryRunner): "--num-database-workers is obligatory flag on apollo" assert not APOLLO or self.args.num_client_workers, \ "--num-client-workers is obligatory flag on apollo" - database = Memgraph(remaining_args, self.args.runner_config, - self.args.num_database_workers) + database = Memgraph(remaining_args, self.args.num_database_workers) super(MemgraphParallelRunner, self).__init__( remaining_args, database, self.args.num_client_workers) diff --git a/tools/memory_usage b/tools/memory_usage index 075ae6734..8f3e30c8a 100755 --- a/tools/memory_usage +++ b/tools/memory_usage @@ -10,7 +10,6 @@ sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../tests/macro_benchmark/") from databases import * from clients import * -from common import get_absolute_path def avg_no_label_node_size(memgraph, client, measure_points): node_size_sum = 0 @@ -70,9 +69,7 @@ def avg_edge_size(memgraph, client, measure_points): return edge_size_sum / len(measure_points) def main(): - path = get_absolute_path("benchmarking.conf", "config") - - memgraph = Memgraph(None, path, 1) + memgraph = Memgraph(None, 1) client = QueryClient(None, 1) measure_points = [10**6, 2*10**6, 5*10**6, 10*10**6] diff --git a/tools/snapshot_recovery_speed b/tools/snapshot_recovery_speed index e506f506a..782169461 100755 --- a/tools/snapshot_recovery_speed +++ b/tools/snapshot_recovery_speed @@ -12,17 +12,16 @@ sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../tests/macro_benchmark/") from databases import * from clients import * -from common import get_absolute_path def main(): - path = get_absolute_path("benchmarking.conf", "config") durability_dir = tempfile.TemporaryDirectory() - DURABILITY_DIR_ARG = ["--durability-directory", durability_dir.name] - MAKE_SNAPSHOT_ARGS = ["--snapshot-on-exit"] + DURABILITY_DIR_ARG - RECOVER_SNAPSHOT_ARGS = ["--db-recover-on-startup"] + DURABILITY_DIR_ARG - snapshot_memgraph = Memgraph(MAKE_SNAPSHOT_ARGS, path, 1) - recover_memgraph = Memgraph(RECOVER_SNAPSHOT_ARGS, path, 1) + DURABILITY_DIR_ARG = ["--data-directory", durability_dir.name] + MAKE_SNAPSHOT_ARGS = ["--storage-snapshot-on-exit"] + DURABILITY_DIR_ARG + RECOVER_SNAPSHOT_ARGS = ["--storage-recover-on-startup"] + \ + DURABILITY_DIR_ARG + snapshot_memgraph = Memgraph(MAKE_SNAPSHOT_ARGS, 1) + recover_memgraph = Memgraph(RECOVER_SNAPSHOT_ARGS, 1) client = QueryClient(None, 1) results = []