18F/identity-loadtest

Rescue the exception when the logout link is not found

jgrevich opened this issue · 2 comments

When the logout link is found we get the following error:

[2021-07-07 20:31:19,311] j13/ERROR/locust.user.task: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/locust/user/task.py", line 290, in run
    self.execute_next_task()
  File "/usr/local/lib/python3.9/site-packages/locust/user/task.py", line 315, in execute_next_task
    self.execute_task(self._task_queue.pop(0))
  File "/usr/local/lib/python3.9/site-packages/locust/user/task.py", line 327, 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_sign_in(self)
  File "/Users/jjg/Documents/sources/login/identity-loadtest/load_testing/common_flows/flow_sp_sign_in.py", line 136, in do_sign_in
    logout_link = sp_signout_link(resp)
  File "/Users/jjg/Documents/sources/login/identity-loadtest/load_testing/common_flows/flow_helper.py", line 164, in sp_signout_link
    if "/logout" not in href:
TypeError: argument of type 'NoneType' is not iterable

We should rescue from that exception so that locust can record that as a failure.

We ran into this issue before: https://gsa-tts.slack.com/archives/C010L0SE4E8/p1586795114166400

While investigating this issue I noticed that the user lands here in the failed state:

Your login credentials were used in another browser. Please sign in again to continue in this browser.

Screen Shot 2021-07-08 at 3 15 43 PM

Related to https://github.com/18F/identity-devops/issues/3596 since this is likely happening due to the reuse of test users

Ditto for
Screen Shot 2023-02-01 at 2 27 00 PM

And the exceptions that occur when a worker is overloaded, and a test user is stuck waiting on IAL for > 60s: https://github.com/18F/identity-loadtest/blob/main/load_testing/lib/flow_sp_ial2_sign_up.py#L321-L336