Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

@Execution(ExecutionMode.SAME_THREAD)
class BigQueryReadClientTest {
private static MockBigQueryRead mockBigQueryRead;
private static MockServiceHelper serviceHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@
import java.util.function.Supplier;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

@Execution(ExecutionMode.SAME_THREAD)
class ConnectionWorkerPoolTest {

private FakeBigQueryWrite testBigQueryWrite;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

@Execution(ExecutionMode.SAME_THREAD)
class ConnectionWorkerTest {
private static final Logger log = Logger.getLogger(StreamWriter.class.getName());
private static final String TEST_STREAM_1 = "projects/p1/datasets/d1/tables/t1/streams/s1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

@Execution(ExecutionMode.SAME_THREAD)
class JsonStreamWriterTest {

private static final int NUMERIC_SCALE = 9;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

@Execution(ExecutionMode.SAME_THREAD)
class RequestProfilerTest {
private static final Logger log = Logger.getLogger(RequestProfiler.class.getName());

Expand Down Expand Up @@ -164,6 +167,9 @@ void concurrentProfilingTest_1000ReqsRunTogether() throws Exception {
assertTrue(reportText.contains("Request uuid: request_30 with total time"));
assertTrue(reportText.contains("Request uuid: request_25 with total time"));
assertTrue(reportText.contains("Request uuid: request_20 with total time"));

threadPool.shutdown();
threadPool.awaitTermination(10, TimeUnit.SECONDS);
}

@Test
Expand Down Expand Up @@ -208,5 +214,8 @@ void concurrentProfilingTest_RunWhileFlushing() throws Exception {
}
String reportText = profilerHook.flushAndGenerateReportText();
assertTrue(reportText.contains("0 requests finished during"));

threadPool.shutdown();
threadPool.awaitTermination(10, TimeUnit.SECONDS);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

@Execution(ExecutionMode.SAME_THREAD)
class StreamWriterTest {

private static final Logger log = Logger.getLogger(StreamWriterTest.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

/** Integration tests for BigQuery Write API. */
@Execution(ExecutionMode.SAME_THREAD)
class ITBigQueryStorageWriteClientTest {
private static final Logger LOG =
Logger.getLogger(ITBigQueryStorageWriteClientTest.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class ResourceHeaderTest {

private static final String TEST_STREAM_NAME = "streamName";

private static final String NAME = "resource-header-test:123";
private static final String NAME = "resource-header-test:123-v1";

private static final String HEADER_NAME = "x-goog-request-params";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

@Execution(ExecutionMode.SAME_THREAD)
class BigQueryStorageClientTest {
private static MockBigQueryStorage mockBigQueryStorage;
private static MockServiceHelper serviceHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ResourceHeaderTest {

private static final Stream TEST_STREAM = Stream.newBuilder().setName("streamName").build();

private static final String NAME = "resource-header-test:123";
private static final String NAME = "resource-header-test:123-v1beta1";

private static final String HEADER_NAME = "x-goog-request-params";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

@Execution(ExecutionMode.SAME_THREAD)
class BigQueryReadClientTest {
private static MockBigQueryRead mockBigQueryRead;
private static MockServiceHelper serviceHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class ResourceHeaderTest {

private static final String TEST_STREAM_NAME = "streamName";

private static final String NAME = "resource-header-test:123";
private static final String NAME = "resource-header-test:123-v1beta2";

private static final String HEADER_NAME = "x-goog-request-params";

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
junit.jupiter.execution.parallel.enabled = true
junit.jupiter.execution.parallel.mode.default = concurrent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered also setting junit.jupiter.execution.parallel.mode.classes.default = concurrent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that is an option. I labelled them with the annotation for now so that we can investigate how to make them parallel (easier to find in the future).

Loading