Skip to content

Commit 22399b4

Browse files
committed
Set testNow to start of minute to (hopefully?) prevent random off-by-milliseconds failures on ci
1 parent 1f1de81 commit 22399b4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/Licensing/LicenseManagerTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Tests\Licensing;
44

55
use Illuminate\Contracts\Support\MessageBag;
6+
use Illuminate\Support\Carbon;
67
use Illuminate\Support\Collection;
78
use Statamic\Licensing\AddonLicense;
89
use Statamic\Licensing\LicenseManager;
@@ -133,6 +134,8 @@ public function it_gets_the_addon_licenses()
133134
/** @test */
134135
public function it_checks_for_request_failures()
135136
{
137+
Carbon::setTestNow(now()->startOfMinute());
138+
136139
tap($this->managerWithResponse(['error' => 500]), function ($licenses) {
137140
$this->assertTrue($licenses->requestFailed());
138141
$this->assertEquals(500, $licenses->requestErrorCode());
@@ -161,7 +164,7 @@ public function it_checks_for_request_failures()
161164
$this->assertTrue($licenses->requestFailed());
162165
$this->assertEquals(429, $licenses->requestErrorCode());
163166
$this->assertTrue($licenses->requestRateLimited());
164-
$this->assertEquals(9, $licenses->failedRequestRetrySeconds());
167+
$this->assertEquals(10, $licenses->failedRequestRetrySeconds());
165168
$this->assertInstanceOf(MessageBag::class, $licenses->requestValidationErrors());
166169
$this->assertEquals([], $licenses->requestValidationErrors()->all());
167170
});

tests/Licensing/OutpostTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class OutpostTest extends TestCase
1919
public function setUp(): void
2020
{
2121
parent::setUp();
22-
Carbon::setTestNow();
22+
Carbon::setTestNow(now()->startOfMinute());
2323
}
2424

2525
/** @test */

0 commit comments

Comments
 (0)