Fix bug with false autostop

This commit is contained in:
Andrey Pohilko 2012-09-25 17:49:53 +04:00
parent 1e424641e0
commit 64bb50bea3
5 changed files with 28 additions and 7 deletions

View File

@ -209,7 +209,7 @@ class HTTPCodesCriteria(AbstractCriteria):
if aggregate_second.overall.RPS: if aggregate_second.overall.RPS:
matched_responses = float(matched_responses) / aggregate_second.overall.RPS matched_responses = float(matched_responses) / aggregate_second.overall.RPS
else: else:
matched_responses = 1 matched_responses = 0
self.log.debug("HTTP codes matching mask %s: %s/%s", self.codes_mask, matched_responses, self.level) self.log.debug("HTTP codes matching mask %s: %s/%s", self.codes_mask, matched_responses, self.level)
if matched_responses >= self.level: if matched_responses >= self.level:
@ -276,7 +276,7 @@ class NetCodesCriteria(AbstractCriteria):
if aggregate_second.overall.RPS: if aggregate_second.overall.RPS:
matched_responses = float(matched_responses) / aggregate_second.overall.RPS matched_responses = float(matched_responses) / aggregate_second.overall.RPS
else: else:
matched_responses = 1 matched_responses = 0
self.log.debug("Net codes matching mask %s: %s/%s", self.codes_mask, matched_responses, self.level) self.log.debug("Net codes matching mask %s: %s/%s", self.codes_mask, matched_responses, self.level)
if matched_responses >= self.level: if matched_responses >= self.level:

View File

@ -162,7 +162,6 @@ class JMeterReader(AbstractReader):
return self.pop_second() return self.pop_second()
else: else:
return None return None
class JMeterInfoWidget(AbstractInfoWidget, AggregateResultListener): class JMeterInfoWidget(AbstractInfoWidget, AggregateResultListener):

View File

@ -81,6 +81,21 @@ class AutostopTestCase(TankTestCase):
raise RuntimeError() raise RuntimeError()
self.foo.end_test(0) self.foo.end_test(0)
def test_run_false_trigger_bug(self):
data = SecondAggregateData()
data.overall.http_codes = {}
self.foo.core.set_option(self.foo.SECTION, "autostop", "http (5xx, 100%, 1)")
self.foo.configure()
self.foo.prepare_test()
self.foo.start_test()
for n in range(1, 15):
self.foo.aggregate_second(data)
if self.foo.is_test_finished() >= 0:
raise RuntimeError()
self.foo.end_test(0)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.2"> <jmeterTestPlan version="1.2" properties="2.3">
<hashTree> <hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true"> <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp> <stringProp name="TestPlan.comments"></stringProp>
@ -30,10 +30,10 @@
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp> <stringProp name="HTTPSampler.domain">127.0.0.1</stringProp>
<stringProp name="HTTPSampler.port"></stringProp> <stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp> <stringProp name="HTTPSampler.connect_timeout">100</stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp> <stringProp name="HTTPSampler.response_timeout">200</stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp> <stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp> <stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/</stringProp> <stringProp name="HTTPSampler.path">/</stringProp>

7
debian/changelog vendored
View File

@ -1,3 +1,10 @@
yandex-load-tank-base (1.0.9) precise; urgency=low
* add ab functionality
* add JMeter functionality
-- Andrey Pohilko (undera) <undera@yandex-team.ru> Tue, 25 Sep 2012 17:29:42 +0400
yandex-load-tank-base (1.0.8) precise; urgency=low yandex-load-tank-base (1.0.8) precise; urgency=low
* change screen layout * change screen layout