-
Notifications
You must be signed in to change notification settings - Fork 196
Atexit refactor with tests #3252
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
Atexit refactor with tests #3252
Conversation
|
Thanks for submitting a PR! Maybe @vpodzime can review this? |
Codecov Report
@@ Coverage Diff @@
## master #3252 +/- ##
==========================================
- Coverage 64.22% 63.34% -0.89%
==========================================
Files 210 211 +1
Lines 46544 46593 +49
==========================================
- Hits 29893 29514 -379
- Misses 16651 17079 +428
Continue to review full report at Codecov.
|
3f2c639 to
fa2dcc9
Compare
|
@olehermanse @vpodzime this PR is ready for review. I will squash that last "cleanup" commit. Do you think I should squash the two other commits as well? The first, 55565f9 is the refactor, fa2dcc9 is the tests. |
|
I think the best way to look at it is: Does the commit make more sense if you squash it or less? |
|
Right. I should have two commits: one refactor+test, one whitespace. Will do. :) |
e23f747 to
c3c8292
Compare
|
Ok. Commits cleaned up. Thanks @olehermanse :) |
|
@olehermanse @vpodzime this is ready for a final code review if you would be so kind. When you are working of course. :) Before rewriting commit history all non-exotics passed on jenkins. |
c3c8292 to
04c1afe
Compare
|
@cf-bottom jenkins build thanks |
|
Sure, I triggered a build: |
vpodzime
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me otherwise. The gdb integration is a really cool idea, we should extend it to increase coverage in other places too.
cf-agent/cf-agent.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird indentation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think this is a debugging leftover, right?
libutils/logging.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to fsync(stdout)?
90e88d6 to
0ed576c
Compare
|
@cf-bottom jenkins build please |
|
Alright, I triggered a build: |
|
This pull request introduces 1 alert when merging 0ed576ccd957ccdf8b1b7da83e0cc5401dd5cd33 into eb7750c - view on LGTM.com new alerts:
Comment posted by LGTM.com |
0ed576c to
76195c0
Compare
|
@cf-bottom jenkins again |
|
Alright, I triggered a build: |
76195c0 to
0edf865
Compare
|
needed a rebase from upstream master. @cf-bottom another jenkins please |
|
Sure, I triggered a build: |
|
@cf-bottom oops, forgot that enterprise PR was included, adjusted there so jenkins build please |
|
Sure, I triggered a build: |
|
Travis seems be consistently failing on this. 😞 |
|
@olehermanse @vpodzime how would you guys feel about disabling these gdb driven tests on exotics and/or essentially if gdb version is less-than some value that works? Chasing down odd behavior in older versions seems a bit too much work and we already get a lot of benefit from these tests on many platforms. |
|
@cf-bottom if you would please, jenkins exotics |
|
Alright, I triggered a build: (with exotics) |
ae5c47e to
a78d1de
Compare
|
@cf-bottom jenkins with exotics please |
|
Sure, I triggered a build: (with exotics) |
|
@cf-bottom try again please: jenkins exotics |
|
Alright, I triggered a build: (with exotics) |
nickanderson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found minor issues with test metadata. I did not do a deep dive, there are many test addtions here! +++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a meta attribute attached to it referencing the jira issue.
I think it may not skip properly without the issue reference.
"test_skip_needs_work" string => "redhat_4|debian_4|aix|debian_6|hpux", meta => { "ENT-3765" };
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also if you add a "description" string then the tests print that out when running.
You can see an example of failing output from tests that contain description and soft_fail here: https://tracker.mender.io/browse/CFE-2910
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Nick. I'll take a look tomorrow. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as other comment about meta attribute for jira issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta attribute for jira issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta attribute for jira issue
|
@cf-bottom jenkins exotics please, now that I have rebased enterprise properly :p |
|
Sure, I triggered a build: (with exotics) |
|
@cf-bottom another jenkins exotics try please |
|
Alright, I triggered a build: (with exotics) |
nickanderson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you added the meta tag to the meta promises that indicate the tests should be skipped on platforms where they need work.
LGTM.
resolved, not sure why github isn't auto-resolving it.
|
@cf-bottom jenkins exotics please |
|
Alright, I triggered a build: (with exotics) |
|
Well @cf-bottom, could you have mentioned that my dependent repo PR wasn't up-to-date with master? Maybe... oh well. Another try at jenkins + exotics please. |
|
Alright, I triggered a build: (with exotics) |
|
I could probably improve coverage for cf-promises and cf-serverd but not by much and not for anything truly significant. I think this PR is ready to merge. Thanks for all the feedback/help with this monster. |
Refactored use of atexit() to use of a custom cleanup mechanism. On Windows atexit() functions are called during the unloading process and we have some atexit() functions which rely on DLLs so this will not work reliably. Refactored so all platforms use RegisterCleanupFunction() and DoCleanupAndExit() instead of atexit() and exit().
5b07fb5 to
64679e9
Compare
|
@cf-bottom jenkins exotics please -craig(ghi) |
|
Sure, I triggered a build: (with exotics) |
…ith-tests Atexit refactor with tests
See if combining the refactoring and tests to cover refactoring works well with coverage/travis/jenkins. This is the "right" way to do things.
merge together:
#3252
https://github.com/cfengine/enterprise/pull/429