10000 [Lock] Pedantic improvements for lock · symfony/symfony@dc568c0 · GitHub
[go: up one dir, main page]

Skip to content

Commit dc568c0

Browse files
greg0irefabpot
authored andcommitted
[Lock] Pedantic improvements for lock
1 parent f82beb5 commit dc568c0

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/Symfony/Component/Lock/StoreInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function waitAndSave(Key $key);
4343
*
4444
* If the store does not support this feature it should throw a NotSupportedException.
4545
*
46-
* @param float $ttl amount of second to keep the lock in the store
46+
* @param float $ttl amount of seconds to keep the lock in the store
4747
*
4848
* @throws LockConflictedException
4949
* @throws NotSupportedException

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract protected function getStore();
3636
*/
3737
public function testBlockingLocks()
3838
{
39-
// Amount a microsecond used to order async actions
39+
// Amount of microseconds we should wait without slowing things down too much
4040
$clockDelay = 50000;
4141

4242
if (\PHP_VERSION_ID < 50600 || \defined('HHVM_VERSION_ID')) {

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
trait ExpiringStoreTestTrait
2121
{
2222
/**
23-
* Amount a microsecond used to order async actions.
23+
* Amount of microseconds used as a delay to test expiration. Should be
24+
* small enough not to slow the test suite too much, and high enough not to
25+
* fail because of race conditions.
2426
*
2527
* @return int
2628
*/
@@ -34,7 +36,7 @@ abstract protected function getStore();
3436
/**
3537
* Tests the store automatically delete the key when it expire.
3638
*
37-
* This test is time sensible: the $clockDelay could be adjust.
39+
* This test is time-sensitive: the $clockDelay could be adjusted.
3840
*/
3941
public function testExpiration()
4042
{
@@ -71,14 +73,13 @@ public function testAbortAfterExpiration()
7173
/**
7274
* Tests the refresh can push the limits to the expiration.
7375
*
74-
* This test is time sensible: the $clockDelay could be adjust.
76+
* This test is time-sensitive: the $clockDelay could be adjusted.
7577
*/
7678
public function testRefreshLock()
7779
{
78-
// Amount a microsecond used to order async actions
80+
// Amount of microseconds we should wait without slowing things down too much
7981
$clockDelay = $this->getClockDelay();
8082

81-
// Amount a microsecond used to order async actions
8283
$key = new Key(uniqid(__METHOD__, true));
8384

8485
/** @var StoreInterface $store */

0 commit comments

Comments
 (0)
0