Skip to content

Add publisher/subscription matched count API test coverage.#119

Merged
hidmic merged 4 commits intomasterfrom
hidmic/rmw-pub-sub-count-tests
Sep 2, 2020
Merged

Add publisher/subscription matched count API test coverage.#119
hidmic merged 4 commits intomasterfrom
hidmic/rmw-pub-sub-count-tests

Conversation

@hidmic
Copy link
Copy Markdown

@hidmic hidmic commented Aug 20, 2020

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Copy Markdown
Author

hidmic commented Aug 20, 2020

Matching pub/sub tests are not passing for rmw_connext_cpp. Arguably, these tests lack (1) a wait on the graph guard condition, and (2) an upper bound for repeated waits.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic changed the title [WIP] Add publisher/subscription matched count API test coverage. Add publisher/subscription matched count API test coverage. Aug 24, 2020
@hidmic hidmic requested review from Blast545 and brawner August 24, 2020 20:13
}

TEST_F(
CLASSNAME(TestPublisherUse, RMW_IMPLEMENTATION),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This alignment is strange since it aligns with the code. Is there not a way to adjust the indentation, or move the curly brace to a new line?

This happens elsewhere as well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That's uncrustify... I ended up shortening the test case name in da38188.

*/
#define SLEEP_AND_RETRY_UNTIL(delay, timeout) for ( \
auto loop_start_time = std::chrono::steady_clock::now(), \
iteration_start_time = loop_start_time; \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is iteration_start_time needed? Why can't you just use std::this_thread::sleep_for(delay) instead of sleep_until?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

To avoid the time it takes to actually execute the loop code from adding up. Also, std::this_thread::sleep_for makes no guarantees as to which clock is used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess I mean something like:

#define SLEEP_AND_RETRY_UNTIL(delay, timeout) \
  for (auto start = std::chrono::steady_clock::now(); \ 
       std::chrono::steady_clock::now() - start < timeout; \
       std::this_thread::sleep_for(delay))

If you'd rather leave it as is, then I'm fine with it. It just seems like your use case doesn't require such precision.

Copy link
Copy Markdown
Author

@hidmic hidmic Aug 24, 2020

Choose a reason for hiding this comment

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

I didn't want to lose retries due to non-negligible execution times, but it is true that these timeouts are pretty arbitrary anyways.

Sure, why not. See 4d85be9.

)
target_compile_definitions(test_init_shutdown${target_suffix}
PUBLIC "RMW_IMPLEMENTATION=${rmw_implementation}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This added line can be removed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done in da38188.

hidmic added 2 commits August 24, 2020 18:07
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Copy link
Copy Markdown
Contributor

@Blast545 Blast545 left a comment

Choose a reason for hiding this comment

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

LGTM

@hidmic
Copy link
Copy Markdown
Author

hidmic commented Aug 26, 2020

CI up to test_rmw_implementation, against all Tier 1 RMW implementations:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@hidmic
Copy link
Copy Markdown
Author

hidmic commented Sep 1, 2020

@ros-pull-request-builder retest this please

1 similar comment
@hidmic
Copy link
Copy Markdown
Author

hidmic commented Sep 2, 2020

@ros-pull-request-builder retest this please

@hidmic
Copy link
Copy Markdown
Author

hidmic commented Sep 2, 2020

Finally! PR job's green. Merging.

@hidmic hidmic merged commit a41e97a into master Sep 2, 2020
@delete-merged-branch delete-merged-branch bot deleted the hidmic/rmw-pub-sub-count-tests branch September 2, 2020 17:22
ahcorde pushed a commit that referenced this pull request Oct 9, 2020
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
ahcorde pushed a commit that referenced this pull request Oct 21, 2020
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
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.

3 participants