Skip to content

Commit

Permalink
Removed a lock test
Browse files Browse the repository at this point in the history
  • Loading branch information
avpaderno committed Feb 17, 2025
1 parent 1a90f25 commit 586c1b7
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions tests/apc_storage_lock.test
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class ApcStorageLockTestCase extends ApcStorageBaseTestCase {
}

/**
* Tests that locks are acquired and expire after a maximum of 10 seconds.
* Tests that locks are acquired and expire after the set timeout.
*/
public function testAcquireLock(): void {
if ($this->skipTest) {
Expand All @@ -133,37 +133,6 @@ class ApcStorageLockTestCase extends ApcStorageBaseTestCase {
return;
}

if ($this->assertTrue($this->initLocks(), 'All the locks have been created.')) {
$max_timeout = $this->acquireLocks(2.0, 4.0);
$delay = (int) $max_timeout + 1;

$this->pass(format_string('Tests will be halted for @seconds seconds.', array('@seconds' => $delay)));
sleep($delay);

foreach ($this->lockNames as $name) {
$lock = ApcStorageLock::get($name);
$message = format_string(
'The lock @name is available after @delay seconds.',
array('@name' => $name, '@delay' => $delay)
);

$this->assertTrue($lock->maybeAvailable(), $message);
}
}
}

/**
* Tests that locks are acquired and expire after a maximum of 50 seconds.
*/
public function testAcquireLockLongerTimeout(): void {
if ($this->skipTest) {
return;
}

if (!$this->assertApcuEmpty()) {
return;
}

if ($this->assertTrue($this->initLocks(), 'All the locks have been created.')) {
$max_timeout = $this->acquireLocks(12.0, 16.0);
$delay = (int) ($max_timeout / 4);
Expand Down

0 comments on commit 586c1b7

Please sign in to comment.