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

Dramatically speed up the demo_nodes_cpp tests #641

Merged
merged 5 commits into from Jul 25, 2023

Conversation

clalancette
Copy link
Contributor

The purpose of this PR is to speed up the demo_nodes_cpp tests. On my local machine, prior to this PR, the tests took ~5 minutes to run. After this PR, they take ~1 minute.

To achieve this, this PR does a number of different things:

  1. Instead of waiting an unconditional 5 seconds for each process to quit, it runs a loop checking every 100 milliseconds for the process to quit, and doing this for up to 5 seconds.
  2. Change it so that we can pass parameters into the individual tests as we are running them. This required work both in CMakeList.txt and in the test launcher, but facilitates the rest of the changes.
  3. Add parameters to talker, listener, content_filtering_publisher, and add_two_ints_server to control their behavior. The major goal here is to keep their default behavior the same, but add in alternate modes to dramatically speed up tests.

The individual commits have more information about each change and why I made it.

This is still a draft because I want to run extensive CI on it, particularly on Windows.

@clalancette clalancette force-pushed the clalancette/speed-up-demo-nodes-cpp-tests branch from 8bc42bc to 49db06b Compare June 12, 2023 14:03
@clalancette
Copy link
Contributor Author

clalancette commented Jun 12, 2023

CI (with retest-until-fail 30):

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

@clalancette clalancette linked an issue Jun 12, 2023 that may be closed by this pull request
That is, just wait long enough for the process to have
an exit code.  On its own, this change doesn't actually
make a huge difference to the test times, but when combined
with some of the upcoming changes it should make a
significant reduction.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Make them use underscores for the member variables,
and make those member variables private.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
That way we can configure some of the demos to be much
more speedy, while retaining their default behavior.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
IF the one-shot parameter is set, then it will quit
after receiving the first request.  Useful for testing.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
This can shorten our tests dramatically.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette clalancette force-pushed the clalancette/speed-up-demo-nodes-cpp-tests branch from 49db06b to 2d802db Compare July 20, 2023 19:48
@clalancette
Copy link
Contributor Author

clalancette commented Jul 20, 2023

To try and get this out of draft, here is normal CI for this PR:

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

And here is Windows run with --retest-until-fail 30, both with and without this PR:

  • Windows Before PR Build Status
  • Windows With PR Build Status

@clalancette
Copy link
Contributor Author

After comparing the test failures before and after on Windows, I think it is fair to say that these failures aren't caused by this PR. That is, this PR seems to make no difference there (we should debug those failures separately).

So I'm actually going to take this out of draft status so we can review and get this in.

@clalancette clalancette marked this pull request as ready for review July 24, 2023 18:06
Copy link
Member

@audrow audrow left a comment

Choose a reason for hiding this comment

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

LGTM!

@clalancette clalancette merged commit b8c4501 into rolling Jul 25, 2023
3 checks passed
@clalancette clalancette deleted the clalancette/speed-up-demo-nodes-cpp-tests branch July 25, 2023 13:49
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.

Long sleep time for the execution of each demo test case
3 participants