Browse Source

changed cache test to wait more than expirytime

change is to avoid random test failure on race condition.
fixes #203 #231
tags/2.0.0-beta
Carsten Brandt 12 years ago
parent
commit
71a9efdd55
  1. 3
      tests/unit/framework/caching/CacheTest.php

3
tests/unit/framework/caching/CacheTest.php

@ -110,7 +110,8 @@ abstract class CacheTest extends TestCase
$this->assertTrue($cache->set('expire_test', 'expire_test', 2)); $this->assertTrue($cache->set('expire_test', 'expire_test', 2));
sleep(1); sleep(1);
$this->assertEquals('expire_test', $cache->get('expire_test')); $this->assertEquals('expire_test', $cache->get('expire_test'));
sleep(2); // wait a bit more than 2 sec to avoid random test failure
usleep(2500000);
$this->assertFalse($cache->get('expire_test')); $this->assertFalse($cache->get('expire_test'));
} }

Loading…
Cancel
Save