Browse Source
Merge pull request #12813 from dashevchenko/alarmCountWSTestFix
Fixed flaky alarm count test
pull/12825/head
Viacheslav Klimov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
5 additions and
2 deletions
-
application/src/main/java/org/thingsboard/server/service/subscription/DefaultTbEntityDataSubscriptionService.java
-
application/src/test/java/org/thingsboard/server/controller/WebsocketApiTest.java
|
|
|
@ -436,7 +436,9 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc |
|
|
|
ctx.sendWsMsg(update); |
|
|
|
} else { |
|
|
|
ctx.doFetchAlarmCount(); |
|
|
|
ctx.createAlarmSubscriptions(); |
|
|
|
if (entitiesIds != null) { |
|
|
|
ctx.createAlarmSubscriptions(); |
|
|
|
} |
|
|
|
TbAlarmCountSubCtx finalCtx = ctx; |
|
|
|
ScheduledFuture<?> task = scheduler.scheduleWithFixedDelay( |
|
|
|
() -> refreshDynamicQuery(finalCtx), |
|
|
|
|
|
|
|
@ -83,7 +83,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. |
|
|
|
@Slf4j |
|
|
|
@DaoSqlTest |
|
|
|
@TestPropertySource(properties = { |
|
|
|
"server.ws.alarms_per_alarm_status_subscription_cache_size=5" |
|
|
|
"server.ws.alarms_per_alarm_status_subscription_cache_size=5", |
|
|
|
"server.ws.dynamic_page_link.refresh_interval=15" |
|
|
|
}) |
|
|
|
public class WebsocketApiTest extends AbstractControllerTest { |
|
|
|
@Autowired |
|
|
|
|