Skip to content

Commit

Permalink
BZJU-643. Avoid 0.001 in rps value in order to reduce timeouts (Blaze…
Browse files Browse the repository at this point in the history
  • Loading branch information
StasPivPerforce authored May 29, 2024
1 parent 3b3bb41 commit 4c57bc2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bzt/jmx/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ def _add_shaper(self, jmx):
if self.load.ramp_up:
if isinstance(self.load.throughput, numeric_types) and self.load.duration:
start_rps = self.load.throughput / float(self.load.duration)
start_rps = max(start_rps, 0.001) # avoid zeroing
start_rps = min(start_rps, 1.0) # avoid starting too fast
if start_rps < 1.0:
start_rps = 1.0 # avoid zeroing
else:
start_rps = 1

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/jmeter/test_JMX.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def test_TST_low_val(self):
self.obj.modify(self.jmx)

self.assertListEqual(self._get_tst_schedule(),
[["0.001", "2.0", "300"], ["2.0", "2.0", "6900"]], )
[["1.0", "2.0", "300"], ["2.0", "2.0", "6900"]], )

def _get_tst_schedule(self):
records = []
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/jmeter/test_JMeterExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ def test_add_shaper_ramp_up(self):

val_strings = coll_elements[0].findall(".//stringProp")

self.assertEqual("0.05", val_strings[0].text)
self.assertEqual("1.0", val_strings[0].text)
self.assertEqual("9.0", val_strings[1].text)
self.assertEqual("60", val_strings[2].text)

Expand Down

0 comments on commit 4c57bc2

Please sign in to comment.