Skip to content

Add test for timeout parameter#19

Merged
jacquelinekay merged 1 commit intomasterfrom
wait_timeout
Aug 5, 2015
Merged

Add test for timeout parameter#19
jacquelinekay merged 1 commit intomasterfrom
wait_timeout

Conversation

@jacquelinekay
Copy link
Copy Markdown
Contributor

Connects to ros2/ros2#73

This test could be prone to flakiness due to scheduling nondeterminism, hence the extremely high tolerance. If we'd prefer to avoid flaky tests, I'm fine with declining this change, but I posted it to prove the correctness of my timeout PRs.

@jacquelinekay jacquelinekay added the in progress Actively being worked on (Kanban column) label Jul 27, 2015
@dirk-thomas
Copy link
Copy Markdown
Member

This does not add any test yet only an executable.

@jacquelinekay
Copy link
Copy Markdown
Contributor Author

Alright, now I have actually added the nosetest in ament.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why all this copied complexity if the test is not actually ever running a publisher or receives a message?

@jacquelinekay
Copy link
Copy Markdown
Contributor Author

I reduced the test quite a lot since I probably won't use the extra functionality copied from test_subscriber, and clarified/corrected some print statements.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Uninitialized variable. Also avoiding global variables would be better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can I just throw a runtime error in the callback instead, since it's not expecting to receive a message?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sure.

@dirk-thomas
Copy link
Copy Markdown
Member

This should be moved to the test_rclcpp package as suggested here: #20 (comment)

@jacquelinekay
Copy link
Copy Markdown
Contributor Author

should I convert this test to a gtest to be consistent with the other test in test_rclcpp or is it fine to keep it as a nosetest?

@dirk-thomas
Copy link
Copy Markdown
Member

I would say keeping it as a nosetest is perfectly fine.

@jacquelinekay jacquelinekay force-pushed the wait_timeout branch 3 times, most recently from 2787a73 to abbac31 Compare August 4, 2015 21:41
@dirk-thomas
Copy link
Copy Markdown
Member

After looking at it again I have to change my opinion: since the test only uses a single executable a GTest would be less overhead then a nosetest with a launch file.

@esteve
Copy link
Copy Markdown
Member

esteve commented Aug 4, 2015

+1

1 similar comment
@wjwwood
Copy link
Copy Markdown
Member

wjwwood commented Aug 4, 2015

+1

@tfoote
Copy link
Copy Markdown
Contributor

tfoote commented Aug 4, 2015

Since there's not multi-node testing a gtest would be better. It's much less overhead setting up and can support much more precise testing.

@dirk-thomas
Copy link
Copy Markdown
Member

@jacquelinekay You have merged the other related PRs but not this one. Currently all platforms fail to build:
http://ci.ros2.org/job/ros2_batch_ci_linux/148/
http://ci.ros2.org/job/ros2_batch_ci_osx/76/
http://ci.ros2.org/job/ros2_batch_ci_windows/104/

Please fix it.

@jacquelinekay
Copy link
Copy Markdown
Contributor Author

I've converted the test to a Gtest and rebased. This pull request will fix the broken build, so assuming @dirk-thomas and @tfoote find these changes acceptable, I will squash and merge after CI comes out clean. Sound good?

http://ci.ros2.org/job/ros2_batch_ci_linux/149/
http://ci.ros2.org/job/ros2_batch_ci_osx/77/
http://ci.ros2.org/job/ros2_batch_ci_windows/105/

@dirk-thomas
Copy link
Copy Markdown
Member

The commit log and diff contains entries which are already on master. So something is wrong with the rebase of this branch.

@dirk-thomas
Copy link
Copy Markdown
Member

The Windows build failed with:

Cannot run when setup is in progress.

May be @j-rivero is currently installing the released version of VS?

@j-rivero
Copy link
Copy Markdown

j-rivero commented Aug 5, 2015

Ouch yes, sorry, I started but did not finish the process, mainly because of this question.

Edit: by the way, May I have rights (I already logged in using the github account) in jenkins so I can disable the node temporary while I'm updating the system? Thanks.

@jacquelinekay
Copy link
Copy Markdown
Contributor Author

Did not pull before rebasing, should look better now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please don't change this. You likely don't have an up-to-date version of the ament linter repo.

@jacquelinekay
Copy link
Copy Markdown
Contributor Author

  1. Will leaving out the target_compile_definitions cause the jobs that I just launched to fail? I tried individual executable on my machine and it worked without that line, but it may not work with make test or however the gtests get invoked on Jenkins. If so, I will relaunch.
  2. What are we going to do about the broken Windows build? Do you prefer we wait until it's fixed before this is merged?

@dirk-thomas
Copy link
Copy Markdown
Member

Without the definition the three result files will have the same name and therefore don't tell the user which exact test is running. Leaving it out won't affect the result of the build - only the generated test result files. You can keep the current CI jobs running.

We still need to merge this asap since currently nobody can build the master branches. As soon as the Windows build works again you should check for regressions and address them after the fact.

@jacquelinekay
Copy link
Copy Markdown
Contributor Author

@j-rivero
Copy link
Copy Markdown

j-rivero commented Aug 5, 2015

I will relaunch the job and post the results or feedback here as soon as the windows node is back.

@jacquelinekay
Copy link
Copy Markdown
Contributor Author

Linux and OSX are clean. I'm merging.

jacquelinekay added a commit that referenced this pull request Aug 5, 2015
Add test for timeout parameter
@jacquelinekay jacquelinekay merged commit 4c84324 into master Aug 5, 2015
@jacquelinekay jacquelinekay removed the in progress Actively being worked on (Kanban column) label Aug 5, 2015
@jacquelinekay jacquelinekay deleted the wait_timeout branch August 5, 2015 16:44
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