Skip to content

Commit 9fdbb53

Browse files
authored
test: disable mTLS during tests (GoogleCloudPlatform#3822)
Disable mTLS during tests to increase the execution speed. The check whether mTLS is available is otherwise executed for every new SpannerStub creation, and this check is relatively slow, especially on macos. This has caused the macos tests to time out regularly in the past week.
1 parent 133a5a4 commit 9fdbb53

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/test/java/com/google/cloud/spanner/pgadapter/AbstractMockServerTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.google.cloud.NoCredentials;
2424
import com.google.cloud.ServiceOptions;
2525
import com.google.cloud.spanner.Dialect;
26+
import com.google.cloud.spanner.DisableDefaultMtlsProvider;
2627
import com.google.cloud.spanner.ErrorCode;
2728
import com.google.cloud.spanner.MockSpannerServiceImpl;
2829
import com.google.cloud.spanner.MockSpannerServiceImpl.StatementResult;
@@ -1282,6 +1283,8 @@ protected static void doStartMockSpannerAndPgAdapterServers(
12821283
Consumer<TestOptionsMetadataBuilder> optionsConfigurator,
12831284
OpenTelemetry openTelemetry)
12841285
throws Exception {
1286+
DisableDefaultMtlsProvider.disableDefaultMtlsProvider();
1287+
12851288
mockSpanner = mockSpannerService;
12861289
mockSpanner.setAbortProbability(0.0D); // We don't want any unpredictable aborted transactions.
12871290
mockSpanner.putStatementResult(

0 commit comments

Comments
 (0)