Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/client/esp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ def count_failed_requests(out):
""" Count failed and non-2xx responses """
failed = 0
non2xx = 0
completed = 0
for metrics, _, _ in out:
failed += metrics.get('Failed requests', [0])[0]
non2xx += metrics.get('Non-2xx responses', [0])[0]
return failed, non2xx
completed += metrics.get('Complete requests', [0])[0]
return failed, non2xx, completed

if __name__ == "__main__":
try:
Expand Down Expand Up @@ -186,8 +188,8 @@ def count_failed_requests(out):
if FLAGS.test_env:
esp_perfkit_publisher.Publish(results, test_env)

failed, non2xx = count_failed_requests(results)
if failed + non2xx > 0:
failed, non2xx, completed = count_failed_requests(results)
if failed + non2xx > 0.005 * completed:
sys.exit(
('Load test failed:\n'
' {} failed requests,\n'
Expand Down