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(binding-opcua;binding-coap) fix some test issues and resource leaks #519

Merged
merged 7 commits into from
Oct 11, 2021

Conversation

erossignon
Copy link
Contributor

in particular, some resources leaks in coap and opcua test that prevents tests to terminate..

As a consequence it should be possible after this fix to run mocha without specifying --exit options to force termination.

@erossignon erossignon marked this pull request as draft September 21, 2021 05:26
@erossignon erossignon marked this pull request as ready for review September 21, 2021 05:45
@erossignon erossignon force-pushed the BugFix/FixTestIssues branch 2 times, most recently from 4cab861 to 905596f Compare September 21, 2021 18:57
@erossignon erossignon changed the title fixes some test issues fix(binding-opcua;binding-coap) fix some test issues and resource leaks Sep 21, 2021
@danielpeintner
Copy link
Member

The tests fail

@relu91
Copy link
Member

relu91 commented Sep 22, 2021

I am wondering why we didn't see any blocking issue before. 🤔 Even the latest PRs completed the test successfully.

Another note: it seems that this PR also solves eslint errors, but it is quite confusing since opc-ua is not actually included (yet) among eslint checked packages. In other words, it does not have the lint script in the package json, it should be added before fixing the eslint errors.

@erossignon erossignon marked this pull request as draft September 22, 2021 09:54
@erossignon
Copy link
Contributor Author

lint issue:

My vscode is configured with the Prettier and eslint and highlights automatically the formatting or eslint error in the editor,
Error are easily spotted. it doesn't harm to fix some error now even if this project is not formally checked yet. we can add this in a different PR.

why problem was not spotted before ?

because mocha is configured to uses the --exit flag, and the --exit flag hides the problem. I will remove the --exit flag in a second phase.

@relu91
Copy link
Member

relu91 commented Sep 22, 2021

Where is the exit flag?
https://github.com/eclipse/thingweb.node-wot/blob/1cd63abc520b9dcba96e3b88e348cbd83752f673/packages/binding-opcua/package.json#L51

https://github.com/eclipse/thingweb.node-wot/blob/1cd63abc520b9dcba96e3b88e348cbd83752f673/packages/binding-coap/package.json#L47

My vscode is configured with the Prettier and eslint and highlights automatically the formatting or eslint error in the editor,
Error are easily spotted. it doesn't harm to fix some error now even if this project is not formally checked yet. we can add this in a different PR.

Yeah also mine, but I would prefer to have consistency so if you don't mind I'd add the lint command in this PR.

@erossignon erossignon force-pushed the BugFix/FixTestIssues branch 2 times, most recently from 7866a42 to e153e9b Compare September 22, 2021 11:38
@JKRhb
Copy link
Member

JKRhb commented Sep 22, 2021

It seems to me as if the CI got stuck in the tests for 06eb231. Maybe this run can be cancelled?

@danielpeintner
Copy link
Member

It seems to me as if the CI got stuck in the tests for 06eb231. Maybe this run can be cancelled?

cancelled the workflow

@erossignon erossignon force-pushed the BugFix/FixTestIssues branch 2 times, most recently from 7122c38 to ab29804 Compare September 23, 2021 08:50
@JKRhb
Copy link
Member

JKRhb commented Sep 23, 2021

Hmm, I am afraid the CI got stuck again.

@JKRhb
Copy link
Member

JKRhb commented Sep 23, 2021

Running the tests for this PR locally, it seems that the OPCUA client tests pass but the test suite doesn't terminate.

@erossignon
Copy link
Contributor Author

erossignon commented Sep 24, 2021

Sorry, I put this PR into "draft" mode in order to prevent unnecessary reviewing while this is being still worked on.
I have excluded temporarily the attempt to fix the binding-opcua => this will come in a separate PR.

I will remove the "Draft" status when the PR will be ready for review.

@erossignon
Copy link
Contributor Author

I have separated the going fix for the binding-opcua into an other PR.

@erossignon erossignon marked this pull request as ready for review September 26, 2021 14:26
@danielpeintner
Copy link
Member

Most of the changes are in HTTP. @relu91 may I ask you to take a look?

Copy link
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

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

I have couple of comments/suggestions after resolving those we can merge it 😃

packages/binding-coap/test/coap-client-test.ts Outdated Show resolved Hide resolved
packages/binding-http/test/http-client-test.ts Outdated Show resolved Hide resolved
packages/binding-http/test/http-client-test.ts Outdated Show resolved Hide resolved
packages/binding-http/test/http-client-test.ts Outdated Show resolved Hide resolved
packages/binding-http/test/http-client-test.ts Outdated Show resolved Hide resolved
@relu91
Copy link
Member

relu91 commented Sep 28, 2021

Just to be sure, so the blocking issues were not in the HTTP binding right? I'm just concerned about the fact that we've never spotted it before.

@erossignon erossignon force-pushed the BugFix/FixTestIssues branch 2 times, most recently from dd9192d to 5d99b9d Compare October 4, 2021 21:29
@relu91
Copy link
Member

relu91 commented Oct 5, 2021

One note: once we have fixed the CI issues here, we have to check if some of the coap open issues are solved by this.

@erossignon erossignon force-pushed the BugFix/FixTestIssues branch 2 times, most recently from 0add37d to e1124d1 Compare October 5, 2021 20:36
@relu91 relu91 mentioned this pull request Oct 6, 2021
@erossignon
Copy link
Contributor Author

may I suggest that we use "rebase merging" as a default merge to master strategy to help creating a nice linear history in git ?
image

Copy link
Member

@danielpeintner danielpeintner left a comment

Choose a reason for hiding this comment

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

LGTM

@relu91 ?

@danielpeintner
Copy link
Member

may I suggest that we use "rebase merging" as a default merge to master strategy to help creating a nice linear history in git ?

I don't have a strong opinion.
I just noticed that @JKRhb squashes commits usually ... hence there seem to be different preferences.

@erossignon
Copy link
Contributor Author

may I suggest that we use "rebase merging" as a default merge to master strategy to help creating a nice linear history in git ?

I don't have a strong opinion. I just noticed that @JKRhb squashes commits usually ... hence there seem to be different preferences.

Yes, squashing is also fine, although it can be made upfront on the developer side by doing a git rebase -i in his PR.
I am more about avoiding the merge commits that create complicated flow in the history.

@JKRhb
Copy link
Member

JKRhb commented Oct 8, 2021

I just noticed that @JKRhb squashes commits usually

That is a bit of a habit that I developed working with RIOT OS and their Git Workflow. They make extensive use of fixup! commits and the --autosquash flag of git rebase to keep the commit history clean.

may I suggest that we use "rebase merging" as a default merge to master strategy to help creating a nice linear history in git ?

If I see correctly, using the rebase option for merging does not create a merge commit at all, right? I would say having a reference on the main branch to PR the changes originated from would still be useful. But rebasing before the merge (with or without squashing) is definitely a good idea :)

@relu91
Copy link
Member

relu91 commented Oct 11, 2021

LGTM

@relu91 ?

There is still one open comment from my previous review, but I can cover it myself. 👍🏻

About the merge strategy, I think this is not a good place to discuss it, I'll open an issue when we can explore different options/opinions.

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.

4 participants