Browse Source
Merge pull request #6639 from YevhenBondarenko/fix/tests
[3.4] fixed tests
pull/6665/head
Andrew Shvayka
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
1 deletions
-
application/src/test/java/org/thingsboard/server/service/cluster/routing/HashPartitionServiceTest.java
-
common/message/src/test/java/org/thingsboard/server/common/msg/tools/RateLimitsTest.java
|
|
@ -85,7 +85,9 @@ public class HashPartitionServiceTest { |
|
|
.addAllServiceTypes(Collections.singletonList(ServiceType.TB_CORE.name())) |
|
|
.addAllServiceTypes(Collections.singletonList(ServiceType.TB_CORE.name())) |
|
|
.build()); |
|
|
.build()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
clusterRoutingService.init(); |
|
|
clusterRoutingService.init(); |
|
|
|
|
|
clusterRoutingService.partitionsInit(); |
|
|
clusterRoutingService.recalculatePartitions(currentServer, otherServers); |
|
|
clusterRoutingService.recalculatePartitions(currentServer, otherServers); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -67,7 +67,7 @@ public class RateLimitsTest { |
|
|
assertThat(rateLimits.tryConsume()).as("new token is available").isFalse(); |
|
|
assertThat(rateLimits.tryConsume()).as("new token is available").isFalse(); |
|
|
|
|
|
|
|
|
int expectedRefillTime = period * 1000; |
|
|
int expectedRefillTime = period * 1000; |
|
|
int gap = 300; |
|
|
int gap = 500; |
|
|
|
|
|
|
|
|
await("tokens refill for rate limit " + rateLimitConfig) |
|
|
await("tokens refill for rate limit " + rateLimitConfig) |
|
|
.atLeast(expectedRefillTime - gap, TimeUnit.MILLISECONDS) |
|
|
.atLeast(expectedRefillTime - gap, TimeUnit.MILLISECONDS) |
|
|
|