Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request_id key not found causes unlogged error #25

Open
1 task
jgrevich opened this issue Oct 5, 2020 · 0 comments
Open
1 task

request_id key not found causes unlogged error #25

jgrevich opened this issue Oct 5, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@jgrevich
Copy link
Member

jgrevich commented Oct 5, 2020

Summary

Similar in nature to #24, errors occur during load test runs that are not logged as request failures, skewing the results, at least in regard to request success/failure. In this case there is an error parsing the request params where it expects there to be a request_id key. Similar to #24 it appears that the failure is not logged and the request is retried.

Detail

I started the SP based sign in test using the following configuration:

NUM_USERS=10000 SP_HOST=https://sp-oidc-sinatra.pt.identitysandbox.gov locust --locustfile load_testing/sp_sign_in.locustfile.py --host https://idp.pt.identitysandbox.gov  --users 50 --hatch-rate 10 --run-time 30m --headless

While running I noticed repeating errors caused by the lack of the request_id key in the parameters:

[2020-10-05 15:05:38,215] j12/ERROR/locust.user.task: 'request_id'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/locust/user/task.py", line 284, in run
    self.execute_next_task()
  File "/usr/local/lib/python3.8/site-packages/locust/user/task.py", line 309, in execute_next_task
    self.execute_task(self._task_queue.pop(0))
  File "/usr/local/lib/python3.8/site-packages/locust/user/task.py", line 321, in execute_task
    task(self)
  File "/Users/jjg/Documents/sources/login/identity-loadtest/load_testing/sp_sign_in.locustfile.py", line 9, in sp_sign_in_load_test
    flow_sp_sign_in.do_sp_sign_in(self)
  File "/Users/jjg/Documents/sources/login/identity-loadtest/load_testing/common_flows/flow_sp_sign_in.py", line 47, in do_sp_sign_in
    request_id = querystring_value(resp.url, "request_id")
  File "/Users/jjg/Documents/sources/login/identity-loadtest/load_testing/common_flows/flow_helper.py", line 86, in querystring_value
    return parse_qs(parsed.query)[key][0]
KeyError: 'request_id'

https://github.com/18F/identity-loadtest/blob/master/load_testing/common_flows/flow_helper.py#L85

Steps To Reproduce

See above, note it was run from a home internet connection and resulted in 5-30s response times.

Expected Behavior

The error should be logged as a failed request and included in the failed request summary at the completion of a test run.

Actual Behavior

The errors are not logged and it appears that the request is retried.

Suggested Actions

We should make sure these errors (and any others) are logged and counted as request failures. Perhaps we should have some way of confirming the request counts by type using a separate system.

Acceptance Criteria

  • the missing param/unexpected response errors should be logged and included in the results summary
@jgrevich jgrevich added the bug Something isn't working label Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant