test memory optimization (disable integration rpc, coap, hikari.maximumPoolSize=16, etc).
This commit is contained in:
parent
bf5f11f7c7
commit
0448c9aa03
@ -29,8 +29,10 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hibernate.exception.ConstraintViolationException;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Rule;
|
||||
import org.junit.rules.TestRule;
|
||||
import org.junit.rules.TestWatcher;
|
||||
@ -196,9 +198,20 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest {
|
||||
this.mappingJackson2HttpMessageConverter);
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeWebTestClass() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void afterWebTestClass() throws Exception {
|
||||
Mockito.clearAllCaches();
|
||||
}
|
||||
|
||||
|
||||
@Before
|
||||
public void setupWebTest() throws Exception {
|
||||
log.info("Executing web test setup");
|
||||
log.debug("Executing web test setup");
|
||||
|
||||
if (this.mockMvc == null) {
|
||||
this.mockMvc = webAppContextSetup(webApplicationContext)
|
||||
@ -238,12 +251,12 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest {
|
||||
|
||||
resetTokens();
|
||||
|
||||
log.info("Executed web test setup");
|
||||
log.debug("Executed web test setup");
|
||||
}
|
||||
|
||||
@After
|
||||
public void teardownWebTest() throws Exception {
|
||||
log.info("Executing web test teardown");
|
||||
log.debug("Executing web test teardown");
|
||||
|
||||
loginSysAdmin();
|
||||
doDelete("/api/tenant/" + tenantId.getId().toString())
|
||||
|
||||
@ -192,7 +192,7 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController
|
||||
WidgetsBundle savedWidgetsBundle = doPost("/api/widgetsBundle", widgetsBundle, WidgetsBundle.class);
|
||||
savedWidgetsBundle.setAlias("new_alias");
|
||||
|
||||
Mockito.reset(tbClusterService);
|
||||
Mockito.clearInvocations(tbClusterService);
|
||||
|
||||
doPost("/api/widgetsBundle", savedWidgetsBundle)
|
||||
.andExpect(status().isBadRequest())
|
||||
|
||||
@ -20,6 +20,8 @@ transport.mqtt.enabled=false
|
||||
transport.coap.enabled=false
|
||||
transport.lwm2m.enabled=false
|
||||
transport.snmp.enabled=false
|
||||
coap.enabled=false
|
||||
integrations.rpc.enabled=false
|
||||
|
||||
# Low latency settings to perform tests as fast as possible
|
||||
sql.attributes.batch_max_delay=5
|
||||
@ -63,3 +65,9 @@ sql.ttl.audit_logs.ttl=2592000
|
||||
|
||||
sql.edge_events.partition_size=168
|
||||
sql.ttl.edge_events.edge_event_ttl=2592000
|
||||
#spring.jpa.properties.hibernate.generate_statistics=true
|
||||
#spring.jpa.properties.hibernate.jmx.enabled=true
|
||||
#spring.jpa.properties.hibernate.jmx.usePlatformServer=true
|
||||
#spring.jpa.properties.hibernate.cache.use_query_cache=false
|
||||
#spring.jpa.properties.hibernate.query.plan_cache_max_size=64
|
||||
#spring.jpa.properties.hibernate.query.plan_parameter_metadata_max_size=32
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
<logger name="org.apache.cassandra" level="WARN"/>
|
||||
<logger name="org.cassandraunit" level="INFO"/>
|
||||
<logger name="org.eclipse.leshan" level="INFO"/>
|
||||
<logger name="org.thingsboard.server.controller.AbstractWebTest" level="INFO"/>
|
||||
|
||||
<!-- mute TelemetryEdgeSqlTest that causes a lot of randomly generated errors -->
|
||||
<logger name="org.thingsboard.server.service.edge.rpc.EdgeGrpcSession" level="OFF"/>
|
||||
|
||||
@ -15,7 +15,7 @@ spring.datasource.username=postgres
|
||||
spring.datasource.password=postgres
|
||||
spring.datasource.url=jdbc:tc:postgresql:12.8:///thingsboard?TC_DAEMON=true&TC_TMPFS=/testtmpfs:rw&?TC_INITFUNCTION=org.thingsboard.server.dao.PostgreSqlInitializer::initDb
|
||||
spring.datasource.driverClassName=org.testcontainers.jdbc.ContainerDatabaseDriver
|
||||
spring.datasource.hikari.maximumPoolSize = 50
|
||||
spring.datasource.hikari.maximumPoolSize=16
|
||||
|
||||
queue.rule-engine.queues[0].name=Main
|
||||
queue.rule-engine.queues[0].topic=tb_rule_engine.main
|
||||
|
||||
@ -16,7 +16,7 @@ spring.datasource.username=postgres
|
||||
spring.datasource.password=postgres
|
||||
spring.datasource.url=jdbc:tc:postgresql:12.8:///thingsboard?TC_DAEMON=true&TC_TMPFS=/testtmpfs:rw&?TC_INITFUNCTION=org.thingsboard.server.dao.PostgreSqlInitializer::initDb
|
||||
spring.datasource.driverClassName=org.testcontainers.jdbc.ContainerDatabaseDriver
|
||||
spring.datasource.hikari.maximumPoolSize = 50
|
||||
spring.datasource.hikari.maximumPoolSize=16
|
||||
|
||||
service.type=monolith
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user