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
IOMC/RandomEngine/test fix bug in initialization of sleep timer. #17962
IOMC/RandomEngine/test fix bug in initialization of sleep timer. #17962
Conversation
…' changes value from 0.025 to 0 [-Wliteral-conversion] This is a bug because the intent was to sleep 0.025 seconds not 0 seconds. /build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/f60d4bf7e099ce1e597b02cf09f0745b/opt/cmssw/slc6_amd64_gcc530/cms/cmssw-patch/CMSSW_9_1_CLANG_X_2017-03-15-2300/src/IOMC/RandomEngine/test/TestRandomNumberServiceGlobal.cc:191:11: warning: implicit conversion from 'double' to 'unsigned int' changes value from 0.025 to 0 [-Wliteral-conversion] sleep(0.025); ~~~~~ ^~~~~
A new Pull Request was created by @gartung (Patrick Gartung) for master. It involves the following packages: IOMC/RandomEngine @cmsbuild, @smuzaffar, @Dr15Jones, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are listed here #13028 |
I could be wrong, but I think this fix will still round to 0 even if it evades the warning because the argument of sleep is an unsigned int. I am not sure what the best alternative is. There is nanosleep and also std::this_thread::sleep_for, although I have not actually ever used either one and do not know if they are appropriate for this situation. The second one is in and I do not know whether that is OK or not. |
How about usleep(25000)? |
Pull request #17962 was updated. @cmsbuild, @smuzaffar, @Dr15Jones, @davidlange6 can you please check and sign again. |
Looks good to me. I looked and usleep is used other places in CMSSW. |
please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
Please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @Muzaffar, @davidlange6, @smuzaffar |
+1 |
This is a bug because the intent was to sleep 0.025 seconds not 0 seconds.
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/f60d4bf7e099ce1e597b02cf09f0745b/opt/cmssw/slc6_amd64_gcc530/cms/cmssw-patch/CMSSW_9_1_CLANG_X_2017-03-15-2300/src/IOMC/RandomEngine/test/TestRandomNumberServiceGlobal.cc:191:11: warning: implicit conversion from 'double' to 'unsigned int' changes value from 0.025 to 0 [-Wliteral-conversion]
sleep(0.025);
~~~~~ ^~~~~