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

fix: tets hang up #1906

Merged
merged 1 commit into from
Jul 22, 2024
Merged

fix: tets hang up #1906

merged 1 commit into from
Jul 22, 2024

Conversation

MaximoLiberata
Copy link
Contributor

Fixes (#1897 (comment)).

When you try to execute the tests maybe one of them will fail because it hanged up and never ends. This PR fix that bug in almost all cases.

@MaximoLiberata
Copy link
Contributor Author

@robertsLando try to execute this PR many times and give me feedback if it working right, please.

@robertsLando
Copy link
Member

Thanks for this PR @MaximoLiberata ! I hope you are right, unfortunately I will not be on my pc till Monday but I will definitely look at this ASAP! I checked the changes and it feels strange only this test was causing the issue, my feel was that there were many of them with this same problem. Did they always succeed now or they just fail less?

@MaximoLiberata
Copy link
Contributor Author

MaximoLiberata commented Jul 19, 2024

I'm glad to contribute.

The short answer, they just fail less. There are some more bugs might hang up the tests, but I haven't found the cause yet. I tried to cover all the tests as async/await or change the logic of tests; however, the tests failed. This test in specific was the main bug that hang up other tests that call abstract_client.ts.

On the other hand, when the server is closed or hang up, the tests that use it will hang up. We need to careful with the use of sinon and server, they can create global bugs and affect other unit tests.

Until now, I executed the tests using npm test many times and they hardly ever fail.

Copy link
Member

@robertsLando robertsLando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🙏🏼 LGTM

@robertsLando robertsLando merged commit c462530 into mqttjs:main Jul 22, 2024
5 checks passed
@robertsLando
Copy link
Member

robertsLando commented Jul 26, 2024

@MaximoLiberata Tests seems much more reliable now! Thanks again 🙏🏼

@MaximoLiberata
Copy link
Contributor Author

I'm glad to hear! And thank you for checking 🙏🏼.

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.

2 participants