locust 2.27.1.dev29__py3-none-any.whl → 2.27.1.dev35__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- locust/_version.py +2 -2
- locust/stats.py +17 -11
- locust/test/test_main.py +2 -0
- locust/test/test_web.py +9 -2
- locust/web.py +1 -5
- {locust-2.27.1.dev29.dist-info → locust-2.27.1.dev35.dist-info}/METADATA +1 -1
- {locust-2.27.1.dev29.dist-info → locust-2.27.1.dev35.dist-info}/RECORD +11 -11
- {locust-2.27.1.dev29.dist-info → locust-2.27.1.dev35.dist-info}/LICENSE +0 -0
- {locust-2.27.1.dev29.dist-info → locust-2.27.1.dev35.dist-info}/WHEEL +0 -0
- {locust-2.27.1.dev29.dist-info → locust-2.27.1.dev35.dist-info}/entry_points.txt +0 -0
- {locust-2.27.1.dev29.dist-info → locust-2.27.1.dev35.dist-info}/top_level.txt +0 -0
locust/_version.py
CHANGED
@@ -12,5 +12,5 @@ __version__: str
|
|
12
12
|
__version_tuple__: VERSION_TUPLE
|
13
13
|
version_tuple: VERSION_TUPLE
|
14
14
|
|
15
|
-
__version__ = version = '2.27.1.
|
16
|
-
__version_tuple__ = version_tuple = (2, 27, 1, '
|
15
|
+
__version__ = version = '2.27.1.dev35'
|
16
|
+
__version_tuple__ = version_tuple = (2, 27, 1, 'dev35')
|
locust/stats.py
CHANGED
@@ -708,7 +708,10 @@ class StatsError:
|
|
708
708
|
|
709
709
|
@classmethod
|
710
710
|
def parse_error(cls, error: Exception | str | None) -> str:
|
711
|
-
|
711
|
+
if isinstance(error, str):
|
712
|
+
string_error = error
|
713
|
+
else:
|
714
|
+
string_error = repr(error)
|
712
715
|
target = "object at 0x"
|
713
716
|
target_index = string_error.find(target)
|
714
717
|
if target_index < 0:
|
@@ -730,16 +733,19 @@ class StatsError:
|
|
730
733
|
|
731
734
|
def to_name(self) -> str:
|
732
735
|
error = self.error
|
733
|
-
if isinstance(error,
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
else:
|
741
|
-
|
742
|
-
|
736
|
+
if isinstance(error, str): # in distributed mode, all errors have been converted to strings
|
737
|
+
if error.startswith("CatchResponseError("):
|
738
|
+
# unwrap CatchResponseErrors
|
739
|
+
length = len("CatchResponseError(")
|
740
|
+
unwrapped_error = error[length:-1]
|
741
|
+
else:
|
742
|
+
unwrapped_error = error
|
743
|
+
else: # in standalone mode, errors are still objects
|
744
|
+
if isinstance(error, CatchResponseError):
|
745
|
+
# unwrap CatchResponseErrors
|
746
|
+
unwrapped_error = error.args[0]
|
747
|
+
else:
|
748
|
+
unwrapped_error = repr(error)
|
743
749
|
|
744
750
|
return f"{self.method} {self.name}: {unwrapped_error}"
|
745
751
|
|
locust/test/test_main.py
CHANGED
@@ -2129,6 +2129,8 @@ class AnyUser(HttpUser):
|
|
2129
2129
|
self.assertIn("(index 3) reported as ready", stderr)
|
2130
2130
|
self.assertIn("The last worker quit, stopping test", stderr)
|
2131
2131
|
self.assertIn("Shutting down (exit code 0)", stderr)
|
2132
|
+
# ensure no weird escaping in error report. Not really related to ctrl-c...
|
2133
|
+
self.assertIn(", 'Connection refused') ", stderr)
|
2132
2134
|
|
2133
2135
|
@unittest.skipIf(os.name == "nt", reason="--processes doesnt work on windows")
|
2134
2136
|
def test_workers_shut_down_if_master_is_gone(self):
|
locust/test/test_web.py
CHANGED
@@ -183,10 +183,17 @@ class TestWebUI(LocustTestCase, _HeaderCheckMixin):
|
|
183
183
|
self._check_csv_headers(response.headers, "failures")
|
184
184
|
|
185
185
|
def test_request_stats_with_errors(self):
|
186
|
-
self.stats.log_error("GET", "/", Exception("
|
186
|
+
self.stats.log_error("GET", "/", Exception("Error with special characters {'foo':'bar'}"))
|
187
187
|
response = requests.get("http://127.0.0.1:%i/stats/requests" % self.web_port)
|
188
188
|
self.assertEqual(200, response.status_code)
|
189
|
-
|
189
|
+
|
190
|
+
# escaped, old school
|
191
|
+
# self.assertIn(
|
192
|
+
# '"Exception("Error with special characters{'foo':'bar'}")"', response.text
|
193
|
+
# )
|
194
|
+
|
195
|
+
# not html escaping, leave that to the frontend
|
196
|
+
self.assertIn("\"Exception(\\\"Error with special characters {'foo':'bar'}\\\")", response.text)
|
190
197
|
|
191
198
|
def test_reset_stats(self):
|
192
199
|
try:
|
locust/web.py
CHANGED
@@ -396,11 +396,7 @@ class WebUI:
|
|
396
396
|
for s in chain(sort_stats(environment.runner.stats.entries), [environment.runner.stats.total]):
|
397
397
|
stats.append(s.to_dict())
|
398
398
|
|
399
|
-
for e in environment.runner.errors.values()
|
400
|
-
err_dict = e.serialize()
|
401
|
-
err_dict["name"] = escape(err_dict["name"])
|
402
|
-
err_dict["error"] = escape(err_dict["error"])
|
403
|
-
errors.append(err_dict)
|
399
|
+
errors = [e.serialize() for e in environment.runner.errors.values()]
|
404
400
|
|
405
401
|
# Truncate the total number of stats and errors displayed since a large number of rows will cause the app
|
406
402
|
# to render extremely slowly. Aggregate stats should be preserved.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
locust/__init__.py,sha256=g6oA-Ba_hs3gLWVf5MKJ1mvfltI8MFnDWG8qslqm8yg,1402
|
2
2
|
locust/__main__.py,sha256=vBQ82334kX06ImDbFlPFgiBRiLIinwNk3z8Khs6hd74,31
|
3
|
-
locust/_version.py,sha256=
|
3
|
+
locust/_version.py,sha256=1Qzx4x6QAncZ-BZr1VFJm149xaSi_W3Mk1QiQQEPvv0,428
|
4
4
|
locust/argument_parser.py,sha256=w4-Ue1XAFPwG3sLyXrpdV9ejKjTUOpcSsPBbCKwRbiQ,28740
|
5
5
|
locust/clients.py,sha256=YKuAyMAbxs8_-w7XJw0hc67KFBNNLxibsw6FwiS01Q8,14781
|
6
6
|
locust/debug.py,sha256=We6Z9W0btkKSc7PxWmrZx-xMynvOOsKhG6jmDgQin0g,5134
|
@@ -15,8 +15,8 @@ locust/main.py,sha256=NGjL5QqakU5aeyUzwu2Fh00xVZfC3eoBE3DtfOmRtcM,27854
|
|
15
15
|
locust/py.typed,sha256=gkWLl8yD4mIZnNYYAIRM8g9VarLvWmTAFeUfEbxJLBw,65
|
16
16
|
locust/runners.py,sha256=Go8b8fpOAfFy6JuNcot7KyguHuExA6eoPHVmcgx3RoI,67813
|
17
17
|
locust/shape.py,sha256=t-lwBS8LOjWcKXNL7j2U3zroIXJ1b0fazUwpRYQOKXw,1973
|
18
|
-
locust/stats.py,sha256
|
19
|
-
locust/web.py,sha256=
|
18
|
+
locust/stats.py,sha256=IXhOtYJ_B863kyrHysNQmuFHv2Vd57vE3Rnerwp3bzs,45859
|
19
|
+
locust/web.py,sha256=4XKB_5OJzugXC-YguBg19hhAk1vfOmuOg9UQc7Djkv8,26857
|
20
20
|
locust/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
21
|
locust/contrib/fasthttp.py,sha256=vByPepw35DF84qZ2xK89yHgjOA_8btV0wig_rSR6p4g,26757
|
22
22
|
locust/rpc/__init__.py,sha256=nVGoHWFQxZjnhCDWjbgXIbmFbN9sizAjkhvSs9_642c,58
|
@@ -36,7 +36,7 @@ locust/test/test_interruptable_task.py,sha256=LZKSV-aJNnwfvAxguz6SckBEuGEnfGimoI
|
|
36
36
|
locust/test/test_load_locustfile.py,sha256=v-muHoM-CYu8t7DXm4AQtFP2q8RYfnTTUBqj7uVqhig,8494
|
37
37
|
locust/test/test_locust_class.py,sha256=oGhhOX848jHRQnIfFlhLlW-kHGYLyYsfDX8hM07Ro7g,25506
|
38
38
|
locust/test/test_log.py,sha256=YPY6vgTAy1KaNU2qoVvQrTH5x_mzRrljEHrkSBy3yxs,7553
|
39
|
-
locust/test/test_main.py,sha256=
|
39
|
+
locust/test/test_main.py,sha256=7OuH2-7noD_rbeoKJD9hIZsylSugu7ze3XFIrU1u0HI,85016
|
40
40
|
locust/test/test_old_wait_api.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
41
41
|
locust/test/test_parser.py,sha256=-2VO5Dopg-VoWvIgXrmr7GN40cqrnjUoctBHmVlyewg,17826
|
42
42
|
locust/test/test_runners.py,sha256=xfBdRPOH1CiNk4Rwqmbx6S1e2BDuWdtqDw9omDJ50Ec,159395
|
@@ -47,7 +47,7 @@ locust/test/test_taskratio.py,sha256=SQ-sBqeFm2GhkfCD_57-fPzQrk1ilSw3DRb0_nwyxAI
|
|
47
47
|
locust/test/test_users.py,sha256=lp6yAKGK9_MIs9F7s1Vc3561P4oRavhpeVo2y9w3SUU,2135
|
48
48
|
locust/test/test_util.py,sha256=DmFTgNSWWx8zrsx9_ZGO6MsySmBV1H_GzNIVzzyapCM,1229
|
49
49
|
locust/test/test_wait_time.py,sha256=3evSEp6amMWFrzmSYs71MCeIsu7Rtarldb_HnwgSrU0,2353
|
50
|
-
locust/test/test_web.py,sha256=
|
50
|
+
locust/test/test_web.py,sha256=9FwA03MuR3q3-svU9rMc2gTBQ9t8T1Av1nIU27_dZqg,46100
|
51
51
|
locust/test/test_zmqrpc.py,sha256=kONaZ11hwnneLwaVn7lIDVV7KHpEP2nkxuKhfb9ba3o,2173
|
52
52
|
locust/test/testcases.py,sha256=ZaPYNxSSChAs0nts_13mCGY7WFW8AjXQZdPOvwAK0TY,6961
|
53
53
|
locust/test/util.py,sha256=98HXLClkycNTxLiuy1d3W_tM6dBU9bA-p5ZXMfncaWE,2754
|
@@ -70,9 +70,9 @@ locust/webui/dist/report.html,sha256=sOdZZVgZbqgu86BBCSQf3uQUYXgmgSnXF32JpnyAII8
|
|
70
70
|
locust/webui/dist/assets/favicon.ico,sha256=IUl-rYqfpHdV38e-s0bkmFIeLS-n3Ug0DQxk-h202hI,8348
|
71
71
|
locust/webui/dist/assets/index-941b6e82.js,sha256=G3n5R81Svt0HzbWaV3AV20jLWGLr4X50UZ-Adu2KcxU,1645614
|
72
72
|
locust/webui/dist/assets/logo.png,sha256=EIVPqr6wE_yqguHaqFHIsH0ZACLSrvNWyYO7PbyIj4w,19299
|
73
|
-
locust-2.27.1.
|
74
|
-
locust-2.27.1.
|
75
|
-
locust-2.27.1.
|
76
|
-
locust-2.27.1.
|
77
|
-
locust-2.27.1.
|
78
|
-
locust-2.27.1.
|
73
|
+
locust-2.27.1.dev35.dist-info/LICENSE,sha256=78XGpIn3fHVBfaxlPNUfjVufSN7QsdhpJMRJHv2AFpo,1095
|
74
|
+
locust-2.27.1.dev35.dist-info/METADATA,sha256=Hk6qAOzjM_pIBtt3c3uzIYAN6zMhf7pvvfdSibBBlS4,7264
|
75
|
+
locust-2.27.1.dev35.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
76
|
+
locust-2.27.1.dev35.dist-info/entry_points.txt,sha256=RAdt8Ku-56m7bFjmdj-MBhbF6h4NX7tVODR9QNnOg0E,44
|
77
|
+
locust-2.27.1.dev35.dist-info/top_level.txt,sha256=XSsjgPA8Ggf9TqKVbkwSqZFuPlZ085X13M9orDycE20,7
|
78
|
+
locust-2.27.1.dev35.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|