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

test: fix disconnect errors #998

Merged
merged 9 commits into from
Mar 28, 2024
Merged

test: fix disconnect errors #998

merged 9 commits into from
Mar 28, 2024

Conversation

kalinkrustev
Copy link
Contributor

This fixes multiple issues in the integration tests, that cause random disconnect errors.

  • inappropriate sleep function, that blocks the event loop
  • tests are ended prematurely, the most important .end() calls were moved to subtests
  • consumers are disconnected twice
  • disconnects are not awaited, as they use callbacks and are not async functions

Overall problem is that tests are using tape 4, while reading the source code gives a false impression that they use async/await, which is not true, as it is only supported in tape 5. Migration is not very easy, due to extensive use of .end() calls.

This fix is probably also resolving this issue mojaloop/project#3112

Copy link

sonarcloud bot commented Mar 28, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
80.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@kalinkrustev kalinkrustev merged commit 34f5418 into main Mar 28, 2024
14 of 15 checks passed
kleyow added a commit that referenced this pull request Apr 2, 2024
* fix: cluster performance testing issues (#996)

* test: fix disconnect errors (#998)

* chore(release): 17.6.1 [skip ci]

* chore: fix current tests

* boolean

* chore: add endpoints to test data

* fix endpoint import

* chore: improve validator coverage

* chore: move prepare tests into file to match src structure

---------

Co-authored-by: Kalin Krustev <kalin.krustev@gmail.com>
Co-authored-by: mojaloopci <info@mojaloop.io>
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

Successfully merging this pull request may close these issues.

None yet

2 participants