improve test to mitigate race condition
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 18 Aug 2016 09:45:39 +0000 (11:45 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 18 Aug 2016 15:35:00 +0000 (17:35 +0200)
Change-Id: I923a2d11cad72d0b321e697eb7b784d59f2f5b99
Reviewed-on: http://gerrit.tine20.com/customers/3460
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Tinebase/AccessLogTest.php

index ff7f8b5..4c2e02d 100644 (file)
@@ -50,7 +50,8 @@ class Tinebase_AccessLogTest extends TestCase
 
         $accessLog = $this->_uit->setLogout();
 
-        $this->assertEquals(Tinebase_DateTime::now()->toString(), $accessLog->lo->toString(),
-            'logout time mismatch/empty: ' . print_r($accessLog, true));
+        $now = Tinebase_DateTime::now();
+        $this->assertTrue($now->toString() === $accessLog->lo->toString() || $now->subSecond(1)->toString() === $accessLog->lo->toString(),
+            'logout time mismatch/empty: ' . print_r($accessLog->toArray(), true));
     }
 }