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

locustio-taurus-wrapper.py csv writer can't handle error messages which have comments in them #1720

Open
piratheeshrabendran-GC opened this issue May 5, 2023 · 1 comment
Assignees

Comments

@piratheeshrabendran-GC
Copy link

Hello,

I've discovered an issue with the locustio-taurus-wrapper.py in Taurus, when handling failed requests. It doesn't seem to account for error messages which might contain commas or serialized json data. Please see below is an extract from the locust.log for the error message I've seen:

[2023-05-03 16:40:17,446] COMP/ERROR/root: Uncaught exception in event handler: 
Traceback (most recent call last):
  File "C:\Program Files\Python311\Lib\site-packages\locust\event.py", line 40, in fire
    handler(**kwargs)
  File "C:\Program Files\Python311\Lib\site-packages\bzt\resources\locustio-taurus-wrapper.py", line 75, in __on_request_write
    self.writer.writerow(self.__getrec(request_type, name, response_time, response_length, exception))
  File "C:\Program Files\Python311\Lib\csv.py", line 154, in writerow
    return self.writer.writerow(self._dict_to_list(rowdict))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_csv.Error: need to escape, but no escapechar set

Here is the error message that is being returned from locust.io :

Error report
# occurrences Error
------------------|---------------------------------------------------------------------------------------------------------------------------------------------
117 POST LogoutApi: CatchResponseError('Failed to Logout, Status: 429, error: {"HttpStatus":429,"ErrorMessage":"Request throttled","ErrorCode":5002}')
------------------|---------------------------------------------------------------------------------------------------------------------------------------------

I pinpointed it is relating to line 106 where the dialog is being set. I fixed this locally by setting the dialog to csv.QUOTE_NONNUMERIC but this needs to be change for it to work on blazemeter too

@piratheeshrabendran-GC
Copy link
Author

Hi I was wondering if there has been any update on this? this is still a blocker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants