-
Notifications
You must be signed in to change notification settings - Fork 98
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
Tidy some scripts #454
Tidy some scripts #454
Conversation
Errors reported by Centos covscan /bin/bash in start.test is for echo -n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so ACK by me
Just out of curiosity: wouldn't something as simple as |
and echo -n works anyway
@wferi yes, that makes a lot more sense |
or for the paranoid use mktemp (in a common temp-file) to assure it is really unique ... |
@wenningerk libqb already does this for directories created by the client. This name is the unique name for the service (that clients connect to). These need to be unique for testing so we can run >1 instance at the same time. In normal running those names are well-known names (like cmap/votequorum). |
Yep - running multiple tests (with multiple server instances) in parallel was what I was thinking of + the unlikely case that random numbers might be the same - but as said just for the paranoid ;-) |
The server names are in the UNIX-domain socket namespace, not a filesystem. So mk[s]temp is no help here. There is the option for libqb to use filesystem sockets (which is only used AFAIK for inter-container communication). I have PR somewhere for testing that ;-) |
tests/start.test
Outdated
NAME="$$-`date +%N`" | ||
echo -n "$NAME" > ipc-test-name | ||
|
||
printf "$$-$RANDOM" > ipc-test-name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately $RANDOM
is Bash-specific again, and you already reverted that part.
Speaking of paranoia, I should have proposed printf %s "$$-$RANDOM"
anyway. :)
Ahhh! In that case I'll put the date thing back in again. Thanks for checking. |
Having said that date+%N doesn't work on BSD anyway (it just prints 'N') so I'll do some work on that. And this was going to be a simple PR :) |
I changed %N to %s as BSD's date command doesn't support %N. Seconds + PID should be enough ....
Maybe the mktemp approach isn't that stupid after all - at least it exists on BSD ;-) |
retest this please |
When the PID numbers get big, the socket name overflows the allowed limit
Why not use the PID of the make process, though? You could even communicate it via the environment and get rid of |
On the other hand, isn't the current |
@wferi something racy in libqb? Surely not? ;-) I'm not sure what it would race with though, the tests are run in series even with make -j |
It's been seen to time out too early and fail the tests
Well, this is what I get in
Doesn't this mean that the file reads in the actual tests race with the write in |
oh good, another bug in the test suite! |
I think, for the moment, I'm going to leave that - it's outside the scope of this PR and I don't currently have the motivation to muck around with Makefile.am files (TBH I never have the motivation to much about with Makefile.am files) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good (as long as we ignore parallel builds - and we do) so ACK
Thanks, I will accept patches to make parallel builds work properly ;-) |
Speaking of parallel test, has the |
@wferi I remember looking at it at some point.. I don´t remember the details of the implementation, but I do offer one piece of advice. Some of the libqb tests are very CPU intensive and they have timeouts and alike.. running too many of them in parallel might cause too many false errors. I have experienced this in CI when running multiple libqb builds in parallel (not even the test suite), very often they would fail due to timeouts. CI now serializes libqb builds to avoid that false error. |
@wferi In theory different tests could use a different ipc-test-name. In practice though, only test.ipc actually does any IPC testing so it's not really relevant :) |
Errors reported by Centos covscan
/bin/bash in start.test is for echo -n