Bug 1032123

Summary: [RFE] Add process synchronisation routines
Product: [Fedora] Fedora Reporter: Hubert Kario <hkario>
Component: beakerlibAssignee: Hubert Kario <hkario>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 19CC: azelinka, pmuller, psplicha
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: beakerlib-1.9-3.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-30 06:58:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 970143    
Bug Blocks: 1116308, 1116317    
Attachments:
Description Flags
0001-new-routines-for-socket-based-synchronisation
pmuller: review-
0002-add-synchronisation-to-system-library pmuller: review+

Description Hubert Kario 2013-11-19 15:21:19 UTC
Description of problem:
Usually when starting network servers in the background, especially if used together with valgrind, there can be few second pause between the command is executed and when the server starts listening for new connections.

The usual solution for that is to use "sleep n" command, but it may fail if the system is slower than usual and leads to unnecessary delays on fast systems

Version-Release number of selected component (if applicable):
beakerlib-1.8-1.fc19

Proposition:
Provide a set of beakerlib commands that allow for waiting for specific things to happen before continuing script execution.

I propose following ones:
 * rlWaitForCmd - a generic interface to run any command, see bug 970143
 * rlWaitForSocket - waiting for a socket to start listening for new connections
 * rlWaitForFile - wait until a specific file is created
 * rlWaitForGrep - wait until a file contains a specific string

Comment 1 Hubert Kario 2013-11-19 15:32:03 UTC
Created attachment 826142 [details]
0001-new-routines-for-socket-based-synchronisation

Add new function, rlWaitForSocket, that can wait for a network service
to start. To be used instead of `sleep' when testing network-centric
services.

Comment 2 Hubert Kario 2013-11-19 15:33:14 UTC
Created attachment 826144 [details]
0002-add-synchronisation-to-system-library

Make beakerlib load and install synchronisation related routines by default.

Comment 3 Petr Muller 2013-11-19 16:57:09 UTC
Comment on attachment 826142 [details]
0001-new-routines-for-socket-based-synchronisation

https://lists.fedorahosted.org/pipermail/beakerlib-devel/2013-November/000040.html

Comment 4 Hubert Kario 2013-11-20 19:06:41 UTC
New set of patches posted:

https://lists.fedorahosted.org/pipermail/beakerlib-devel/2013-November/000043.html

Comment 5 Ales Zelinka 2013-11-21 10:03:07 UTC
*** Bug 970143 has been marked as a duplicate of this bug. ***

Comment 6 Hubert Kario 2013-11-21 17:02:13 UTC
Final set of patches posted:

https://lists.fedorahosted.org/pipermail/beakerlib-devel/2013-November/000050.html

Comment 7 Hubert Kario 2013-11-22 15:10:51 UTC
Also, a small bash "wait" wrapper

https://lists.fedorahosted.org/pipermail/beakerlib-devel/2013-November/000058.html

Comment 8 Hubert Kario 2013-11-25 14:53:36 UTC
And another addition:

https://lists.fedorahosted.org/pipermail/beakerlib-devel/2013-November/000060.html

Waiting for the socket to stop listening.

implements rlWaitForSocket --close option

Comment 9 Fedora Update System 2014-06-17 13:43:23 UTC
beakerlib-1.9-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/beakerlib-1.9-1.fc20

Comment 10 Fedora Update System 2014-06-17 23:30:52 UTC
Package beakerlib-1.9-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing beakerlib-1.9-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-7442/beakerlib-1.9-1.fc20
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2014-07-02 08:03:06 UTC
beakerlib-1.9-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/beakerlib-1.9-2.fc20

Comment 12 Dalibor Pospíšil 2014-07-04 08:51:00 UTC
Please consider the package fixing this bug available in Fedora stable repos once bz1116308 is closed and RHEL stable repos once bz1116317 is closed.

Fixed in:
beakerlib-1.9-2.fc19
beakerlib-1.9-2.fc20
beakerlib-1.9-2.fc21
beakerlib-1.9-3.el5
beakerlib-1.9-2.el6
beakerlib-1.9-2.el7

Comment 13 Fedora Update System 2014-07-17 13:16:40 UTC
beakerlib-1.9-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/beakerlib-1.9-3.fc20

Comment 14 Fedora Update System 2014-07-30 06:58:18 UTC
beakerlib-1.9-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.