Browse Source
Merge pull request #15165 from smatvienko-tb/fix/flaky-tenant-controller-test
Fix flaky TenantControllerTest teardown timeout
pull/15197/head
Viacheslav Klimov
7 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
10 additions and
0 deletions
-
application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java
-
application/src/test/resources/application-test.properties
|
|
|
@ -405,6 +405,10 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest { |
|
|
|
public void teardownWebTest() throws Exception { |
|
|
|
log.debug("Executing web test teardown"); |
|
|
|
|
|
|
|
// Drain any pending housekeeper work left by the test body (e.g., bulk tenant deletes)
|
|
|
|
// before proceeding with teardown deletions, to avoid 90s per-tenant wait timing out.
|
|
|
|
awaitHousekeeperDrained(); |
|
|
|
|
|
|
|
loginSysAdmin(); |
|
|
|
deleteTenant(tenantId); |
|
|
|
deleteDifferentTenant(); |
|
|
|
@ -436,6 +440,11 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest { |
|
|
|
.until(() -> storage.getLag("tb_housekeeper") == 0); |
|
|
|
} |
|
|
|
|
|
|
|
protected void awaitHousekeeperDrained() { |
|
|
|
Awaitility.await("housekeeper drained").atMost(5, TimeUnit.MINUTES).during(300, TimeUnit.MILLISECONDS) |
|
|
|
.until(() -> storage.getLag("tb_housekeeper") == 0); |
|
|
|
} |
|
|
|
|
|
|
|
private List<Tenant> getAllTenants() throws Exception { |
|
|
|
List<Tenant> loadedTenants = new ArrayList<>(); |
|
|
|
PageLink pageLink = new PageLink(10); |
|
|
|
|
|
|
|
@ -44,6 +44,7 @@ queue.transport_api.response_poll_interval=5 |
|
|
|
queue.transport.poll_interval=5 |
|
|
|
queue.core.poll-interval=5 |
|
|
|
queue.core.partitions=2 |
|
|
|
queue.core.housekeeper.task-reprocessing-delay-ms=0 |
|
|
|
queue.rule-engine.poll-interval=5 |
|
|
|
|
|
|
|
queue.rule-engine.stats.enabled=true |
|
|
|
|