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

Test 106 failing under Windows in Debug configuration #2585

Closed
claudiofantacci opened this issue Oct 26, 2018 · 3 comments
Closed

Test 106 failing under Windows in Debug configuration #2585

claudiofantacci opened this issue Oct 26, 2018 · 3 comments

Comments

@claudiofantacci
Copy link
Contributor

claudiofantacci commented Oct 26, 2018

Here is the error:

106: Test command: C:\Users\cfantacci\GitHub\pcl\buildd\bin\test_sample_consensus.exe
106: Test timeout computed to be: 9.99988e+06
106: [==========] Running 2 tests from 1 test case.
106: [----------] Global test environment set-up.
106: [----------] 2 tests from SampleConsensus
106: [ RUN      ] SampleConsensus.Base
106: [       OK ] SampleConsensus.Base (0 ms)
106: [ RUN      ] SampleConsensus.InfiniteLoop
106: ..\test\sample_consensus\test_sample_consensus.cpp(100): error: Value of: thread1.timed_join (delay)
106:   Actual: false
106: Expected: true
7/7 Test #106: sample_consensus .................***Failed    1.12 sec

The test simply fails becuase the test checks whether some running threads finish within 1 second or not, while the superslow Debug-compiled code under Windows takes at least (on my PC) 9 seconds.

I propose the change the following line

boost::posix_time::time_duration delay (0, 0, 1, 0);

as follow

#if defined(DEBUG) || defined(_DEBUG)
  boost::posix_time::time_duration delay (0, 0, 15, 0);
#else
  boost::posix_time::time_duration delay (0, 0, 1, 0);
#endif

to differentiate between Debug and Release. I know is not superclean, but testing some code against time constraints is really machine/configuration/time dependent and it is somewhat impredictable, even for trivial-solution algorithms.

Further comments in #2399

@claudiofantacci claudiofantacci mentioned this issue Oct 26, 2018
16 tasks
@taketwo
Copy link
Member

taketwo commented Oct 26, 2018

Thanks for investigating. From my side it's an okay solution.

@claudiofantacci
Copy link
Contributor Author

Resolutive commit: 5239a48

We can close this issue after the merge (there is an hashtag missing in the commit comments to automatically close this issue).

@SergioRAgostinho
Copy link
Member

I'll add it manually to the PR, no worries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants