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

955 Clear out uses of addAction in tests #979

Merged
merged 4 commits into from
Aug 20, 2020

Conversation

JacobDomagala
Copy link
Contributor

@JacobDomagala JacobDomagala commented Aug 11, 2020

  • tests/unit/pipe/test_callback_func.cc:1
  • tests/unit/pipe/test_callback_func_ctx.cc:1
  • tests/unit/pipe/test_callback_send.cc:6
  • tests/unit/pipe/test_callback_send_collection.extended.cc:3
  • tests/unit/rdma/test_rdma_collection_handle.extended.cc:1
  • tests/unit/sequencer/test_sequencer.extended.cc:4
  • tests/unit/sequencer/test_sequencer_extensive.extended.cc:1
  • tests/unit/sequencer/test_sequencer_for.extended.cc:1
  • tests/unit/sequencer/test_sequencer_nested.extended.cc:1
  • tests/unit/sequencer/test_sequencer_parallel.extended.cc:2
  • tests/unit/sequencer/test_sequencer_vrt.extended.cc:3

Following tests are left unchanged (addAction() is a part of termination namespace so i thought its usage here makes sense)

  • tests/unit/termination/test_termination_action_callable.extended.cc:2
  • tests/unit/termination/test_termination_action_common.impl.h:2
  • tests/unit/termination/test_termination_reset.cc:2

@JacobDomagala JacobDomagala force-pushed the 955-clear-out-uses-of-addAction-in-tests-part3 branch from c6842b0 to 12cf645 Compare August 11, 2020 13:26
@JacobDomagala JacobDomagala force-pushed the 955-clear-out-uses-of-addAction-in-tests-part3 branch from 12cf645 to a5cdad1 Compare August 11, 2020 13:43
@codecov
Copy link

codecov bot commented Aug 11, 2020

Codecov Report

Merging #979 into develop will increase coverage by 0.04%.
The diff coverage is 96.90%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #979      +/-   ##
===========================================
+ Coverage    77.35%   77.40%   +0.04%     
===========================================
  Files          656      656              
  Lines        25110    25129      +19     
===========================================
+ Hits         19424    19451      +27     
+ Misses        5686     5678       -8     
Impacted Files Coverage Δ
.../unit/rdma/test_rdma_collection_handle.extended.cc 4.58% <0.00%> (+0.16%) ⬆️
...nit/sequencer/test_sequencer_extensive.extended.cc 100.00% <ø> (ø)
...s/unit/sequencer/test_sequencer_nested.extended.cc 100.00% <ø> (ø)
tests/unit/pipe/test_callback_func.cc 96.15% <100.00%> (+0.15%) ⬆️
tests/unit/pipe/test_callback_func_ctx.cc 97.67% <100.00%> (-0.06%) ⬇️
tests/unit/pipe/test_callback_send.cc 100.00% <100.00%> (ø)
...nit/pipe/test_callback_send_collection.extended.cc 98.01% <100.00%> (+0.31%) ⬆️
tests/unit/sequencer/test_sequencer.extended.cc 100.00% <100.00%> (ø)
...ests/unit/sequencer/test_sequencer_for.extended.cc 100.00% <100.00%> (ø)
...unit/sequencer/test_sequencer_parallel.extended.cc 100.00% <100.00%> (ø)
... and 3 more

@JacobDomagala JacobDomagala force-pushed the 955-clear-out-uses-of-addAction-in-tests-part3 branch 2 times, most recently from cb25503 to 52ece3c Compare August 11, 2020 15:55
@lifflander lifflander changed the title #955 Clear out uses of addAction in tests 955 Clear out uses of addAction in tests Aug 11, 2020
@JacobDomagala JacobDomagala force-pushed the 955-clear-out-uses-of-addAction-in-tests-part3 branch from 52ece3c to ae755fb Compare August 13, 2020 07:10
@JacobDomagala JacobDomagala marked this pull request as ready for review August 13, 2020 07:11
} \
} while (false);
} while (false); \

#define FN_APPLY(SEQ_HAN, SEQ_FN, NODE, MSG_TYPE, ___, IS_TAG) \
Copy link
Member

Choose a reason for hiding this comment

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

@lifflander
Just noticing that the FN_APPLY and CALL_EXPAND macros are each used only once below. That makes their definition as macros seem sort of silly

@PhilMiller
Copy link
Member

For the tests you left alone, here are my thoughts:

  • tests/unit/termination/test_termination_reset.cc:2 - fine as is
  • tests/unit/termination/test_termination_action_callable.extended.cc:2 - it would be good to have runSchedulerThrough(epoch); EXPECT_EQ(num, 2); at the end of the test, though that maybe collides with the broader testing harness in use in channel and action
  • tests/unit/termination/test_termination_action_common.impl.h:2 - goes along with the previous case, and could maybe be restructured in whole.

@PhilMiller
Copy link
Member

Note to self: the files addressed match the files assigned

@PhilMiller PhilMiller requested review from bradybray and cz4rs August 14, 2020 21:25
Copy link
Collaborator

@lifflander lifflander left a comment

Choose a reason for hiding this comment

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

Overall, this looks good to me. I don't see any problems as long as the tests pass consistently,

@lifflander
Copy link
Collaborator

@JacobDomagala Can you address any comments for change and then rebase this on develop?

@JacobDomagala JacobDomagala force-pushed the 955-clear-out-uses-of-addAction-in-tests-part3 branch from ae755fb to fe7f32b Compare August 16, 2020 17:24
Copy link

@bradybray bradybray left a comment

Choose a reason for hiding this comment

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

@JacobDomagala Should line 91 of test_callback_func be changed from runInEpochCollective([=]{ to runInEpochCollective([&}{ so that it has the proper context passed in?

Copy link

@bradybray bradybray left a comment

Choose a reason for hiding this comment

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

Looks good. @JacobDomagala If the = does not need to be replaced would you explain why? AFAIK the & operator in runInEpochCollective is the pass the proper context to the function. This way it has access to the variables in the previous scope. Is this correct?

tests/unit/pipe/test_callback_func.cc Outdated Show resolved Hide resolved
tests/unit/pipe/test_callback_func_ctx.cc Outdated Show resolved Hide resolved
tests/unit/pipe/test_callback_send.cc Outdated Show resolved Hide resolved
@JacobDomagala JacobDomagala force-pushed the 955-clear-out-uses-of-addAction-in-tests-part3 branch from 86b047c to e9dc906 Compare August 17, 2020 12:11
Copy link
Contributor

@cz4rs cz4rs left a comment

Choose a reason for hiding this comment

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

looks good overall to me
depending on the outcome of the discussion about proxy.destroy(); I might need to revisit test_callback_bcast_collection.extended.cc

@lifflander
Copy link
Collaborator

lifflander commented Aug 19, 2020

Looks good. @JacobDomagala If the = does not need to be replaced would you explain why? AFAIK the & operator in runInEpochCollective is the pass the proper context to the function. This way it has access to the variables in the previous scope. Is this correct?

@bradybray Both & and = will supply the context. The difference is whether it's passed by reference or value. = will call the copy constructor on all captured variables. & will just provide a reference to each captured variable. From reading the changed code, most of the callsites just a few small variables are captured (like NodeType which is a int16_t). In those cases, = is fine. The older interface vt::theTerm()->addAction often captures the lambda context by value because it doesn't execute right away. In that case, variables can go out of scope before it executes causing an ugly crash (reference to variable popped off the stack---i.e., junk)

@lifflander
Copy link
Collaborator

@JacobDomagala Is this ready to rebase and merge?

@JacobDomagala JacobDomagala force-pushed the 955-clear-out-uses-of-addAction-in-tests-part3 branch from 374c982 to 8f1fc53 Compare August 19, 2020 08:40
@JacobDomagala
Copy link
Contributor Author

@JacobDomagala Is this ready to rebase and merge?

Yes, rebased on top of develop and it's ready to be merged.

@lifflander
Copy link
Collaborator

@JacobDomagala Github won't let you merge this because you haven't signed your commits with your GPG key. Did you set up GPG? You need to attach it to git so it adds your signature to the commits.

…CallbackSendCollection instead of checking them during Collection destruction
…r checking TestCallbackSendCollection test results
@JacobDomagala JacobDomagala force-pushed the 955-clear-out-uses-of-addAction-in-tests-part3 branch from 8f1fc53 to fa70854 Compare August 19, 2020 18:31
@JacobDomagala
Copy link
Contributor Author

JacobDomagala commented Aug 19, 2020

@JacobDomagala Github won't let you merge this because you haven't signed your commits with your GPG key. Did you set up GPG? You need to attach it to git so it adds your signature to the commits.

Yes, it seems that i lost my commits signatures after i rebased the branch. Should be ok now.

Copy link
Collaborator

Codacy Here is an overview of what got changed by this pull request:

Clones added
============
- tests/unit/pipe/test_callback_send_collection.extended.cc  2
- tests/unit/pipe/test_callback_func_ctx.cc  1
         

Clones removed
==============
+ tests/unit/pipe/test_callback_send.cc  -1
         

See the complete overview on Codacy

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.

6 participants