From 3401e54194add65e60d6635e0f9e7e600b53db07 Mon Sep 17 00:00:00 2001 From: delulu Date: Mon, 4 Nov 2019 17:55:30 +0800 Subject: [PATCH] resolve test failure --- locust/main.py | 2 +- locust/test/test_runners.py | 4 ++-- locust/web.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/locust/main.py b/locust/main.py index 02f8c9ca7c..b7bda8852d 100644 --- a/locust/main.py +++ b/locust/main.py @@ -185,7 +185,7 @@ def parse_options(args=None, default_config_files=['~/.locust.conf','locust.conf # Number of clients to incease by Step parser.add_argument( '--step-clients', - type='int', + type=int, default=1, help="Client count to increase by step in Step Load mode. Only used together with --step-load" ) diff --git a/locust/test/test_runners.py b/locust/test/test_runners.py index 3d37f0016f..a37e9b327d 100644 --- a/locust/test/test_runners.py +++ b/locust/test/test_runners.py @@ -57,7 +57,7 @@ def __init__(self): self.master_bind_host = '*' self.master_bind_port = 5557 self.heartbeat_liveness = 3 - self.heartbeat_interval = 3 + self.heartbeat_interval = 1 self.stop_timeout = None self.step_load = True @@ -219,7 +219,7 @@ class MyTestLocust(Locust): with mock.patch("locust.rpc.rpc.Server", mocked_rpc()) as server: master = MasterLocustRunner(MyTestLocust, self.options) server.mocked_send(Message("client_ready", None, "fake_client")) - sleep(0.1) + sleep(6) # print(master.clients['fake_client'].__dict__) assert master.clients['fake_client'].state == STATE_MISSING diff --git a/locust/web.py b/locust/web.py index f3af3425c1..74a2599e11 100644 --- a/locust/web.py +++ b/locust/web.py @@ -27,7 +27,7 @@ from .stats import failures_csv, median_from_dict, requests_csv, sort_stats, stats_history_csv from .util.cache import memoize from .util.rounding import proper_round -from .util.time import parse_timespan +from .util.timespan import parse_timespan logger = logging.getLogger(__name__)