]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cache: use greaterEquals in tests cases to prevent failures due to race conditions
authorRobin Appelman <icewind@owncloud.com>
Wed, 30 Jan 2013 22:15:28 +0000 (23:15 +0100)
committerRobin Appelman <icewind@owncloud.com>
Wed, 30 Jan 2013 22:15:45 +0000 (23:15 +0100)
tests/lib/files/cache/updater.php

index b4f373cdc2a340b2ea15e86ffece7f7b83be2b77..b83dd0c26e50ab20926388326e838ba48df820ef 100644 (file)
@@ -61,7 +61,7 @@ class Updater extends \PHPUnit_Framework_TestCase {
        }
 
        public function tearDown() {
-               if($this->cache){
+               if ($this->cache) {
                        $this->cache->clear();
                }
                Filesystem::tearDown();
@@ -82,7 +82,7 @@ class Updater extends \PHPUnit_Framework_TestCase {
                $cachedData = $this->cache->get('');
                $this->assertEquals(2 * $textSize + $imageSize + 3, $cachedData['size']);
                $this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
-               $this->assertEquals($mtime, $rootCachedData['mtime']);
+               $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $mtime);
                $rootCachedData = $cachedData;
 
                $this->assertFalse($this->cache->inCache('bar.txt'));
@@ -94,7 +94,7 @@ class Updater extends \PHPUnit_Framework_TestCase {
                $cachedData = $this->cache->get('');
                $this->assertEquals(2 * $textSize + $imageSize + 2 * 3, $cachedData['size']);
                $this->assertNotEquals($rootCachedData['etag'], $cachedData['etag']);
-               $this->assertEquals($mtime, $rootCachedData['mtime']);
+               $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $mtime);
        }
 
        public function testDelete() {