Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2b1a0e5

Browse files
committed
[Lock] Use distinct store for forked processes
1 parent 828ac17 commit 2b1a0e5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Component/Lock/Tests/Store/BlockingStoreTestTrait.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ trait BlockingStoreTestTrait
2222
{
2323
/**
2424
* @see AbstractStoreTest::getStore()
25+
*
26+
* @return StoreInterface
2527
*/
2628
abstract protected function getStore();
2729

@@ -38,8 +40,6 @@ public function testBlockingLocks()
3840
// Amount a microsecond used to order async actions
3941
$clockDelay = 50000;
4042

41-
/** @var StoreInterface $store */
42-
$store = $this->getStore();
4343
$key = new Key(uniqid(__METHOD__, true));
4444
$parentPID = posix_getpid();
4545

@@ -50,6 +50,7 @@ public function testBlockingLocks()
5050
// Wait the start of the child
5151
pcntl_sigwaitinfo(array(SIGHUP), $info);
5252

53+
$store = $this->getStore();
5354
try {
5455
// This call should failed given the lock should already by acquired by the child
5556
$store->save($key);
@@ -71,6 +72,8 @@ public function testBlockingLocks()
7172
} else {
7273
// Block SIGHUP signal
7374
pcntl_sigprocmask(SIG_BLOCK, array(SIGHUP));
75+
76+
$store = $this->getStore();
7477
try {
7578
$store->save($key);
7679
// send the ready signal to the parent

0 commit comments

Comments
 (0)