Skip to content

Fix nowait.phpt to no longer depend on sleeping #2266

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

Closed
wants to merge 1 commit into from

Conversation

mhagstrand
Copy link
Contributor

In Travis CI the nowait.phpt test sometimes fails because of
the usleep() not being long enough ensure proper
execution order. Instead of depending on sleeping the
test now uses two semaphores to guarantee execution order.

In Travis CI the nowait.phpt test sometimes fails because of
the usleep() not being long enough ensure proper
execution order. Instead of depending on sleeping the
test now uses two semaphores to guarantee execution order.
@krakjoe
Copy link
Member

krakjoe commented Jan 2, 2017

Merged 8c5647e

Thanks

@krakjoe krakjoe closed this Jan 2, 2017
@krakjoe
Copy link
Member

krakjoe commented Jan 2, 2017

@mhagstrand can you take another look, last build has failures because of this test ... maybe you missed something ?

https://travis-ci.org/php/php-src/jobs/188211242

@mhagstrand
Copy link
Contributor Author

Thanks @krakjoe! I see the problem from the diff

013+ 
014+ Warning: sem_release(): failed to release key 0x430acb2e: Invalid argument in /home/travis/build/php/php-src/ext/sysvsem/tests/nowait.php on line 66

I released the child semaphore after allowing the child process to continue execution. If the child finishes execution before the parent releases that semaphore, the child removes the semaphore. Then the warning occurs.

sem_release($c_sem_id);

@mhagstrand
Copy link
Contributor Author

My patch to fix this:
#2269

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

Successfully merging this pull request may close these issues.

2 participants