david-streamlio opened a new pull request, #103: URL: https://github.com/apache/pulsar-connectors/pull/103
## Motivation A Testcontainers container started in `@BeforeClass`/`@BeforeMethod` with no `withStartupTimeout` hangs unbounded if the image pull or container start stalls. `@Test(timeOut=...)` does **not** help — it only bounds the test *method*, not the container start in `@BeforeClass`/`@BeforeMethod`. When a start stalls, the test hangs until the CI job's own 45-minute limit is reached, which has repeatedly cancelled unrelated PRs' CI runs (see #89, fixed for the MQTT sink in #91). This PR applies the same fix to the remaining Testcontainers-based tests so a stuck container start fails fast instead of consuming the whole CI job. ## Modifications Added `.withStartupTimeout(Duration.ofMinutes(N))` to every container instance (and `import java.time.Duration;` where missing). No test logic was changed — only the startup-timeout bound was added; all existing wait strategies, env, ports, network, etc. are preserved. `N` values: - **N = 3** — single normal container. - **N = 5** — tests that start a DB container alongside a Pulsar container (the Debezium source tests), and large/slow images (ClickHouse, LocalStack, Pulsar). | # | File | N | |---|------|---| | 1 | `cassandra/.../CassandraStringSinkTest.java` | 3 | | 2 | `debezium/core/.../PulsarSchemaHistoryTest.java` (Pulsar) | 5 | | 3 | `debezium/mariadb/.../DebeziumMariaDbSourceTest.java` (MariaDB + Pulsar) | 5, 5 | | 4 | `debezium/mongodb/.../DebeziumMongoDbSourceTest.java` (Mongo + Pulsar) | 5, 5 | | 5 | `debezium/mysql/.../DebeziumMysqlSourceTest.java` (MySQL + Pulsar) | 5, 5 | | 6 | `debezium/postgres/.../DebeziumPostgresSourceTest.java` (Postgres + Pulsar) | 5, 5 | | 7 | `dynamodb/.../DynamoDBSourceIntegrationTest.java` (LocalStack) | 5 | | 8 | `influxdb/.../v1/InfluxDBGenericRecordSinkIntegrationTest.java` | 3 | | 9 | `influxdb/.../v2/InfluxDBSinkIntegrationTest.java` | 3 | | 10 | `jdbc/clickhouse/.../ClickHouseJdbcSinkIntegrationTest.java` (large image) | 5 | | 11 | `jdbc/mariadb/.../MariadbJdbcSinkIntegrationTest.java` | 3 | | 12 | `kinesis/.../KinesisSinkTest.java` (LocalStack) | 5 | | 13 | `mongo/.../MongoSinkContainerTest.java` | 3 | | 14 | `rabbitmq/.../RabbitMQBrokerManager.java` | 3 | | 15 | `nsq/.../NSQSourceIntegrationTest.java` (nsqlookupd + nsqd) | 3, 3 | All containers already had (or, via the specialized `*Container` classes, provide) a wait strategy, so no new wait strategy was needed. ## Verifying `compileTestJava` succeeds for every touched module: `:cassandra :debezium:pulsar-io-debezium-core :debezium:pulsar-io-debezium-mariadb :debezium:pulsar-io-debezium-mongodb :debezium:pulsar-io-debezium-mysql :debezium:pulsar-io-debezium-postgres :dynamodb :influxdb :jdbc:pulsar-io-jdbc-clickhouse :jdbc:pulsar-io-jdbc-mariadb :kinesis :mongo :rabbitmq :nsq` -> **BUILD SUCCESSFUL**. `spotlessJavaCheck` on all touched modules -> **BUILD SUCCESSFUL** (license/format gate). The two fast, reliable suites were run to confirm no regression: - `:influxdb:test` -> all passed, including the container-backed `InfluxDBSinkIntegrationTest` (1) and `InfluxDBGenericRecordSinkIntegrationTest` (1); 0 failures. - `:nsq:test` -> all passed, including the container-backed `NSQSourceIntegrationTest` (1); 0 failures. The remaining container tests (Cassandra, Mongo, Kinesis, RabbitMQ, Debezium, ClickHouse) were not run locally, as they require amd64 emulation / are slow on arm64 — but the change only adds a startup-timeout bound and cannot alter a passing test's logic. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
