[Lock] Pedantic improvements for lock

This commit is contained in:
Grégoire Paris 2018-12-30 14:11:46 +01:00 committed by Fabien Potencier
parent f82beb51de
commit dc568c0ba1
3 changed files with 8 additions and 7 deletions

View File

@ -43,7 +43,7 @@ interface StoreInterface
*
* If the store does not support this feature it should throw a NotSupportedException.
*
* @param float $ttl amount of second to keep the lock in the store
* @param float $ttl amount of seconds to keep the lock in the store
*
* @throws LockConflictedException
* @throws NotSupportedException

View File

@ -36,7 +36,7 @@ trait BlockingStoreTestTrait
*/
public function testBlockingLocks()
{
// Amount a microsecond used to order async actions
// Amount of microseconds we should wait without slowing things down too much
$clockDelay = 50000;
if (\PHP_VERSION_ID < 50600 || \defined('HHVM_VERSION_ID')) {

View File

@ -20,7 +20,9 @@ use Symfony\Component\Lock\StoreInterface;
trait ExpiringStoreTestTrait
{
/**
* Amount a microsecond used to order async actions.
* Amount of microseconds used as a delay to test expiration. Should be
* small enough not to slow the test suite too much, and high enough not to
* fail because of race conditions.
*
* @return int
*/
@ -34,7 +36,7 @@ trait ExpiringStoreTestTrait
/**
* Tests the store automatically delete the key when it expire.
*
* This test is time sensible: the $clockDelay could be adjust.
* This test is time-sensitive: the $clockDelay could be adjusted.
*/
public function testExpiration()
{
@ -71,14 +73,13 @@ trait ExpiringStoreTestTrait
/**
* Tests the refresh can push the limits to the expiration.
*
* This test is time sensible: the $clockDelay could be adjust.
* This test is time-sensitive: the $clockDelay could be adjusted.
*/
public function testRefreshLock()
{
// Amount a microsecond used to order async actions
// Amount of microseconds we should wait without slowing things down too much
$clockDelay = $this->getClockDelay();
// Amount a microsecond used to order async actions
$key = new Key(uniqid(__METHOD__, true));
/** @var StoreInterface $store */