|
87 | 87 | import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider;
|
88 | 88 | import com.google.cloud.bigtable.data.v2.stub.sql.ExecuteQueryCallable;
|
89 | 89 | import com.google.cloud.bigtable.data.v2.stub.sql.SqlServerStream;
|
| 90 | +import com.google.common.base.Preconditions; |
90 | 91 | import com.google.common.collect.ImmutableMap;
|
91 | 92 | import com.google.common.collect.Queues;
|
92 | 93 | import com.google.common.io.BaseEncoding;
|
@@ -285,6 +286,28 @@ public void testFeatureFlags() throws InterruptedException, IOException, Executi
|
285 | 286 | assertThat(featureFlags.getLastScannedRowResponses()).isTrue();
|
286 | 287 | }
|
287 | 288 |
|
| 289 | + @Test |
| 290 | + public void testPingAndWarmFeatureFlags() |
| 291 | + throws InterruptedException, IOException, ExecutionException { |
| 292 | + EnhancedBigtableStubSettings settings = |
| 293 | + defaultSettings.toBuilder().setRefreshingChannel(true).build(); |
| 294 | + try (EnhancedBigtableStub ignored = EnhancedBigtableStub.create(settings)) { |
| 295 | + Preconditions.checkState( |
| 296 | + !fakeDataService.pingRequests.isEmpty(), "Ping request was not sent during setup"); |
| 297 | + Metadata metadata = metadataInterceptor.headers.take(); |
| 298 | + |
| 299 | + String encodedFeatureFlags = |
| 300 | + metadata.get(Key.of("bigtable-features", Metadata.ASCII_STRING_MARSHALLER)); |
| 301 | + FeatureFlags featureFlags = |
| 302 | + FeatureFlags.parseFrom(BaseEncoding.base64Url().decode(encodedFeatureFlags)); |
| 303 | + |
| 304 | + assertThat(featureFlags.getReverseScans()).isTrue(); |
| 305 | + assertThat(featureFlags.getLastScannedRowResponses()).isTrue(); |
| 306 | + assertThat(featureFlags.getRoutingCookie()).isTrue(); |
| 307 | + assertThat(featureFlags.getRetryInfo()).isTrue(); |
| 308 | + } |
| 309 | + } |
| 310 | + |
288 | 311 | @Test
|
289 | 312 | public void testCheckAndMutateRequestResponseConversion()
|
290 | 313 | throws ExecutionException, InterruptedException {
|
|
0 commit comments