Skip to content

Commit 9d23bc3

Browse files
committed
test & logs
1 parent f4a525f commit 9d23bc3

File tree

14 files changed

+77
-6
lines changed

14 files changed

+77
-6
lines changed

query/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<configuration>
4646
<environmentVariables>
4747
<YDB_DOCKER_FEATURE_FLAGS>enable_resource_pools</YDB_DOCKER_FEATURE_FLAGS>
48+
<!--<YDB_DOCKER_IMAGE>ydbplatform/local-ydb:trunk</YDB_DOCKER_IMAGE>-->
4849
</environmentVariables>
4950
</configuration>
5051
</plugin>

query/src/test/java/tech/ydb/query/QueryExampleTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.junit.BeforeClass;
1212
import org.junit.ClassRule;
1313
import org.junit.FixMethodOrder;
14+
import org.junit.Ignore;
1415
import org.junit.Test;
1516
import org.junit.runners.MethodSorters;
1617

@@ -32,6 +33,7 @@
3233
* @author Alexandr Gorshenin <alexandr268@ydb.tech>
3334
*/
3435
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
36+
@Ignore
3537
public class QueryExampleTest {
3638
@ClassRule
3739
public final static GrpcTransportRule ydbRule = new GrpcTransportRule();

query/src/test/java/tech/ydb/query/TableExampleTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.junit.BeforeClass;
1515
import org.junit.ClassRule;
1616
import org.junit.FixMethodOrder;
17+
import org.junit.Ignore;
1718
import org.junit.Test;
1819
import org.junit.runners.MethodSorters;
1920

@@ -43,6 +44,7 @@
4344
* @author Alexandr Gorshenin <alexandr268@ydb.tech>
4445
*/
4546
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
47+
@Ignore
4648
public class TableExampleTest {
4749
@ClassRule
4850
public final static GrpcTransportRule ydbRule = new GrpcTransportRule();

query/src/test/java/tech/ydb/query/impl/QueryIntegrationTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
*
4545
* @author Aleksandr Gorshenin
4646
*/
47+
@Ignore
4748
public class QueryIntegrationTest {
4849
private final static Logger logger = LoggerFactory.getLogger(QueryIntegrationTest.class);
4950
private final static String TEST_TABLE = "query_service_test";

query/src/test/java/tech/ydb/query/impl/ResourcePoolTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import org.junit.Assert;
88
import org.junit.BeforeClass;
99
import org.junit.ClassRule;
10-
import org.junit.Ignore;
1110
import org.junit.Test;
1211
import org.slf4j.Logger;
1312
import org.slf4j.LoggerFactory;
@@ -40,7 +39,6 @@
4039
*
4140
* @author Evgeny Kuvardin
4241
*/
43-
@Ignore // Resource pools are unstable now
4442
public class ResourcePoolTest {
4543
private final static Logger logger = LoggerFactory.getLogger(ResourcePoolTest.class);
4644

@@ -78,6 +76,8 @@ public static void dropAll() {
7876
client.close();
7977
client = null;
8078
}
79+
80+
ydbTransport.printStdErr();
8181
}
8282

8383
private Status selectWithPool(String poolName) {
@@ -98,7 +98,7 @@ private Status selectWithPool(String poolName) {
9898
private Status createResourcePool(String poolName) {
9999
String createPool = "CREATE RESOURCE POOL " + poolName + " WITH ("
100100
+ "CONCURRENT_QUERY_LIMIT=10,"
101-
+ "QUEUE_SIZE=\"-1\"," // Query size works unstable
101+
+ "QUEUE_SIZE=1000,"
102102
+ "DATABASE_LOAD_CPU_THRESHOLD=80);";
103103
return retryCtx.supplyResult(s -> s.createQuery(createPool, TxMode.NONE).execute()).join().getStatus();
104104
}

tests/common/src/main/java/tech/ydb/test/integration/YdbHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public interface YdbHelper extends AutoCloseable {
1717

1818
String authToken();
1919

20+
String getStdErr();
21+
2022
@Override
2123
void close();
2224
}

tests/common/src/main/java/tech/ydb/test/integration/docker/DockerHelperFactory.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package tech.ydb.test.integration.docker;
22

3+
import org.slf4j.Logger;
4+
import org.slf4j.LoggerFactory;
35
import org.testcontainers.utility.TestcontainersConfiguration;
46

57
import tech.ydb.core.grpc.GrpcTransport;
@@ -15,6 +17,7 @@
1517
* @author Aleksandr Gorshenin
1618
*/
1719
public class DockerHelperFactory extends YdbHelperFactory {
20+
private static final Logger logger = LoggerFactory.getLogger(DockerHelperFactory.class);
1821
private final YdbEnvironment env;
1922
private final YdbDockerContainer container;
2023

@@ -30,6 +33,7 @@ public DockerHelperFactory(YdbEnvironment env, YdbDockerContainer container) {
3033

3134
@Override
3235
public YdbHelper createHelper() {
36+
logger.warn("container start");
3337
container.start();
3438

3539
return new YdbHelper() {
@@ -78,6 +82,11 @@ public void close() {
7882
container.stop();
7983
container.close();
8084
}
85+
86+
@Override
87+
public String getStdErr() {
88+
return container.getLogs();
89+
}
8190
};
8291
}
8392
}

tests/common/src/main/java/tech/ydb/test/integration/docker/ProxedDockerHelperFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ public void close() {
8585
container.stop();
8686
container.close();
8787
}
88+
89+
@Override
90+
public String getStdErr() {
91+
return container.getLogs();
92+
}
8893
};
8994
}
9095
}

tests/common/src/main/java/tech/ydb/test/integration/docker/YdbDockerContainer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public void init() {
6161

6262
withEnv("YDB_USE_IN_MEMORY_PDISKS", "true");
6363
withEnv("YDB_ENABLE_COLUMN_TABLES", "true");
64+
withEnv("YDB_DEFAULT_LOG_LEVEL", "DEBUG");
6465

6566
if (env.dockerFeatures() != null && !env.dockerFeatures().isEmpty()) {
6667
withEnv("YDB_FEATURE_FLAGS", env.dockerFeatures());
@@ -104,6 +105,12 @@ public byte[] pemCert() {
104105
});
105106
}
106107

108+
public void logStdErr() {
109+
String logs = getLogs();
110+
System.out.println(logs);
111+
System.out.println("LOG SIZE = " + logs.length());
112+
}
113+
107114
public String database() {
108115
return env.dockerDatabase();
109116
}

tests/common/src/main/java/tech/ydb/test/integration/external/ExternalHelperFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public byte[] pemCert() {
7777
public void close() {
7878
// Nothing
7979
}
80+
81+
@Override
82+
public String getStdErr() {
83+
return "EXTERNAL";
84+
}
8085
};
8186
}
8287
}

0 commit comments

Comments
 (0)