8000 minor #43847 [RateLimiter] Increase delta in limiter tests (wkania) · symfony/symfony@f3c19ed · GitHub
[go: up one dir, main page]

Skip to content

Commit f3c19ed

Browse files
committed
minor #43847 [RateLimiter] Increase delta in limiter tests (wkania)
This PR was merged into the 5.3 branch. Discussion ---------- [RateLimiter] Increase delta in limiter tests | Q | A | ------------- | --- | Branch? | 5.3 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | License | MIT Tests from [PR](#42168) might randomly fail [1](https://ci.appveyor.com/project/fabpot/symfony/builds/41346868#L597) [2](https://ci.appveyor.com/project/fabpot/symfony/builds/41346183#L650) I increased delta like in [this test](https://github.com/symfony/symfony/blob/5.3/src/Symfony/Component/RateLimiter/Tests/Policy/TokenBucketLimiterTest.php#L90). ![image](https://user-images.githubusercontent.com/57155526/139543405-e8e1b760-96b2-4aea-8ed2-15c6221cd387.png) ![image](https://user-images.githubusercontent.com/57155526/139543418-d9558c2e-9248-49dd-b941-ad917f5e23d2.png) `@fabpot` `@Nyholm` please review Commits ------- 3e2ca33 [RateLimiter] Increase delta in limiter tests
2 parents de0d041 + 3e2ca33 commit f3c19ed

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Symfony/Component/RateLimiter/Tests/Policy/FixedWindowLimiterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testWaitIntervalOnConsumeOverLimit()
7878

7979
$start = microtime(true);
8080
$rateLimit->wait(); // wait 1 minute
81-
$this->assertEqualsWithDelta($start + 60, microtime(true), 0.5);
81+
$this->assertEqualsWithDelta($start + 60, microtime(true), 1);
8282
}
8383

8484
public function testWrongWindowFromCache()

src/Symfony/Component/RateLimiter/Tests/Policy/SlidingWindowLimiterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testWaitIntervalOnConsumeOverLimit()
6666

6767
$start = microtime(true);
6868
$rateLimit->wait(); // wait 12 seconds
69-
$this->assertEqualsWithDelta($start + 12, microtime(true), 0.5);
69+
$this->assertEqualsWithDelta($start + 12, microtime(true), 1);
7070
}
7171

7272
public function testReserve()

src/Symfony/Component/RateLimiter/Tests/Policy/TokenBucketLimiterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function testWaitIntervalOnConsumeOverLimit()
102102

103103
$start = microtime(true);
104104
$rateLimit->wait(); // wait 1 second
105-
$this->assertEqualsWithDelta($start + 1, microtime(true), 0.5);
105+
$this->assertEqualsWithDelta($start + 1, microtime(true), 1);
106106
}
107107

108108
public function testWrongWindowFromCache()

0 commit comments

Comments
 (0)
0