Skip to content

Commit b9b7a67

Browse files
authored
Enable SpannerChangeStreamPlacementTableIT and update IntegrationTestEnv cleanup (#38052)
1 parent 190898c commit b9b7a67

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/it/IntegrationTestEnv.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,12 @@ protected void after() {
155155
.get(TIMEOUT_MINUTES, TimeUnit.MINUTES);
156156
}
157157
} catch (Exception e) {
158-
LOG.error("Failed to drop table {}. Skipping...", table, e);
158+
if (isPlacementTableBasedChangeStream) {
159+
// Drop placement table requires all rows deleted and garbage collected.
160+
LOG.info("Failed to drop table {}. Skipping...", table, e);
161+
} else {
162+
LOG.error("Failed to drop table {}. Skipping...", table, e);
163+
}
159164
}
160165
}
161166

sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/it/SpannerChangeStreamPlacementTableIT.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
import org.junit.Before;
5858
import org.junit.BeforeClass;
5959
import org.junit.ClassRule;
60-
import org.junit.Ignore;
6160
import org.junit.Rule;
6261
import org.junit.Test;
6362
import org.junit.rules.ExpectedException;
@@ -66,12 +65,14 @@
6665

6766
/** End-to-end test of Cloud Spanner placement table. */
6867
@RunWith(JUnit4.class)
69-
@Ignore(
70-
"TODO: enable this test class when placement table is supported by change stream in prod."
71-
+ "For now this test can only be exercised mannually.")
7268
public class SpannerChangeStreamPlacementTableIT {
7369

74-
@ClassRule public static final IntegrationTestEnv ENV = new IntegrationTestEnv();
70+
@ClassRule
71+
public static final IntegrationTestEnv ENV =
72+
new IntegrationTestEnv(
73+
/*isPostgres=*/ false,
74+
/*isPlacementTableBasedChangeStream=*/ true,
75+
/*host=*/ Optional.empty());
7576

7677
@Rule public final transient TestPipeline pipeline = TestPipeline.create();
7778

0 commit comments

Comments
 (0)