From b4459af0256d991d21aef8ed167be47512d20e5d Mon Sep 17 00:00:00 2001 From: Mitch Hagstrand Date: Sun, 1 Jan 2017 21:19:14 -0800 Subject: Fix nowait.phpt to no longer depend on sleeping 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. --- ext/sysvsem/tests/nowait.phpt | 157 +++++++++++++++++++++++++----------------- 1 file changed, 92 insertions(+), 65 deletions(-) (limited to 'ext/sysvsem') diff --git a/ext/sysvsem/tests/nowait.phpt b/ext/sysvsem/tests/nowait.phpt index 0a6fdf4a50..8557ce33ee 100644 --- a/ext/sysvsem/tests/nowait.phpt +++ b/ext/sysvsem/tests/nowait.phpt @@ -1,5 +1,5 @@ --TEST-- -sem_acquire with nowait +Test sem_acquire with nowait option --SKIPIF-- --FILE-- --EXPECTF-- -Parent. +P: parent process running. P: got semaphore Resource id #%i. -P: success acquire semaphore Resource id #%i. -Child. -C: got semaphore Resource id #%i. -P: releases. -C: success acquire semaphore Resource id #%i. -C: releases. -P: success acquire semaphore Resource id #%i. -C: fail to acquire semaphore Resource id #%i. -P: cleanup. +P: acquired semaphore Resource id #%i. +P: acquired semaphore Resource id #%i +C: child process running. +C: got semaphore Resource id #%i and Resource id #%i. +C: failed to acquire semaphore Resource id #%i. +C: releasing semaphore Resource id #%i +P: releasing semaphore Resource id #%i. +C: success acquired semaphore Resource id #%i. +C: releasing semaphore Resource id #%i. +C: removing semaphore Resource id #%i. +P: removing semaphore Resource id #%i. -- cgit v1.2.1