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

Flaky test: test_GetKycDocuments #326

Open
lmonari opened this issue Jan 25, 2023 · 1 comment
Open

Flaky test: test_GetKycDocuments #326

lmonari opened this issue Jan 25, 2023 · 1 comment

Comments

@lmonari
Copy link

lmonari commented Jan 25, 2023

Hi everyone

Recently, we noticed that the test test_GetKycDocuments started failing sometimes. Here are a couple of logs from different test runs:

Run 1

======================================================================
ERROR: test_GetKycDocuments (tests.test_kyc_document.KYCDocumentTestLive)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/tests/test_kyc_document.py", line 12, in test_GetKycDocuments
    result = Document.all(page=1, per_page=2, Sort='CreationDate:ASC')
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/mangopay/base.py", line 264, in all
    return cls.select().all(*args, **kwargs)
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/mangopay/query.py", line 85, in all
    result, data = handler.request(self.method, url, without_client_id=without_client_id, **params)
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/mangopay/api.py", line 64, in request
    return self.custom_request(method, url, data, idempotency_key, oauth_request, True, without_client_id, **params)
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/mangopay/api.py", line [16](https://github.com/plentific/mangopay2-python-sdk/actions/runs/3939465490/jobs/6739356435#step:5:17)1, in custom_request
    self._create_apierror(result, url=url, data=truncated_data, method=method)
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/mangopay/api.py", line 253, in _create_apierror
    raise APIError(text, code=status_code, content=content, headers=headers)
mangopay.exceptions.APIError: {"Message":"Internal Server Error","Type":"other","Id":"1d886124-4542-4f42-b287-0b5e01ad2d90#1673960406","Date":1673960412.0,"errors":null}

Run 2

======================================================================
ERROR: test_GetKycDocuments (tests.test_kyc_document.KYCDocumentTestLive)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/tests/test_kyc_document.py", line 16, in test_GetKycDocuments
    result2 = Document.all(page=1, per_page=2, Sort='CreationDate:DESC')
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/mangopay/base.py", line 264, in all
    return cls.select().all(*args, **kwargs)
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/mangopay/query.py", line 85, in all
    result, data = handler.request(self.method, url, without_client_id=without_client_id, **params)
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/mangopay/api.py", line 64, in request
    return self.custom_request(method, url, data, idempotency_key, oauth_request, True, without_client_id, **params)
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/mangopay/api.py", line 161, in custom_request
    self._create_apierror(result, url=url, data=truncated_data, method=method)
  File "/home/runner/work/mangopay2-python-sdk/mangopay2-python-sdk/mangopay/api.py", line 253, in _create_apierror
    raise APIError(text, code=status_code, content=content, headers=headers)
mangopay.exceptions.APIError: {"Message":"Internal Server Error","Type":"other","Id":"62776014-c2dd-4feb-962d-4e3e837fd118#1674660821","Date":1674660827.0,"errors":null}

As you can see, it fails (sometimes) when calling Document.all(...):

  • in Run 1 at ".../test_kyc_document.py", line 12
  • in Run 2 at ".../test_kyc_document.py", line 16
@lmonari
Copy link
Author

lmonari commented Jan 26, 2023

A more detailed output of the failed test (branch: master)
test_GetKycDocuments_error_logs.txt

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

1 participant