You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/04 22:26:42 UTC

[GitHub] [beam] damccorm opened a new issue, #21240: Java PostCommits produce too many spanner databases

damccorm opened a new issue, #21240:
URL: https://github.com/apache/beam/issues/21240

   Each test in SpannerReadIT and SpannerWriteIT creates its own database, causing us to often go over quota.
   
   Imported from Jira [BEAM-13375](https://issues.apache.org/jira/browse/BEAM-13375). Original Jira may contain additional context.
   Reported by: ibzib.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Java PostCommits produce too many spanner databases [beam]

Posted by "jonathansudhakar1 (via GitHub) via github" <gi...@beam.apache.org>.
jonathansudhakar1 commented on issue #21240:
URL: https://github.com/apache/beam/issues/21240#issuecomment-6898079486

   This looks resolved on current master. #40259 (merged 2026-09-25) moved the database setup in both `SpannerReadIT` and `SpannerWriteIT` from per-test `@Before`/`@After` methods to `@BeforeClass`/`@AfterClass`. Each class now creates its GoogleSQL and PostgreSQL databases once and drops them after its last test:
   
   - `SpannerReadIT`: [`setUpTestEnvironment`](https://github.com/apache/beam/blob/b791929763c12f6080a92e0ec06c04158f6e25e3/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerReadIT.java#L106-L169) and [`tearDown`](https://github.com/apache/beam/blob/b791929763c12f6080a92e0ec06c04158f6e25e3/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerReadIT.java#L508-L517).
   - `SpannerWriteIT`: [`setUpTestEnvironment`](https://github.com/apache/beam/blob/b791929763c12f6080a92e0ec06c04158f6e25e3/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteIT.java#L121-L183) and [`tearDown`](https://github.com/apache/beam/blob/b791929763c12f6080a92e0ec06c04158f6e25e3/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteIT.java#L444-L453). Its remaining per-test [`@Before`](https://github.com/apache/beam/blob/b791929763c12f6080a92e0ec06c04158f6e25e3/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteIT.java#L185-L194) only deletes all rows from the two tables.
   
   So the 16 tests in the two classes now share 4 databases per run, rather than each test creating its own. I checked this by reading the code at b791929763c; I didn't run the ITs, since they need a Spanner instance. If that matches your understanding, this issue can probably be closed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org