-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java CDK, source-postgres: parallelize tests #32314
java CDK, source-postgres: parallelize tests #32314
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Before Merging a Connector Pull RequestWow! What a great pull request you have here! 🎉 To merge this PR, ensure the following has been done/considered for each connector added or updated:
If the checklist is complete, but the CI check is failing,
|
Coverage report for source-postgres
|
@@ -48,7 +48,7 @@ public static Connection createConnection(final JsonNode jdbcConfig) throws SQLE | |||
validateReplicationConnection(connection); | |||
return connection; | |||
} catch (final PSQLException exception) { | |||
if (exception.getMessage().equals("FATAL: must be superuser or replication role to start walsender")) { | |||
if ("42501".equals(exception.getSQLState())) { // insufficient_privilege |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing logic doesn't work for postgres 16. In any case we shouldn't have business logic depending on textual messages, as far as postgres is concerned the sql state values are the proper API to use.
"chmod 0600 ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.key", | ||
"cp ca.crt root/.postgresql/ca.crt", | ||
"chown postgres:postgres ~/.postgresql/ca.crt", | ||
"psql -U test -c \"SELECT pg_reload_conf();\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These all came straight out of PostgresUtils::getCertificate
.
@@ -9,7 +9,7 @@ plugins { | |||
airbyteJavaConnector { | |||
cdkVersionRequired = '0.4.1' | |||
features = ['db-sources'] | |||
useLocalCdk = false | |||
useLocalCdk = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder to undo this and bump the required CDK version after publishing it.
@@ -0,0 +1 @@ | |||
testExecutionConcurrency=-1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This triggers the junit test execution concurrency (instead of the default gradle concurrency). What this means is that the tests run in different threads rather than different processes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we tell also gradle to not do concurrency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed we do, some connectors have testExecutionConcurrency=1
which effectively disables concurrency.
Question: do tests still pass with |
yes, and yes |
} catch (final IOException e) { | ||
throw new UncheckedIOException(e); | ||
} | ||
this.tmpDir.toFile().deleteOnExit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it will delete a directory that's not empty but I might be wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right.
protected String getServerImageName() { | ||
return "debezium/postgres:13-alpine"; | ||
protected static String getServerImageName() { | ||
return "debezium/postgres:12-bullseye"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave maybe some on 13 in case there's a difference between 12 and 13.
Thanks for the review! |
/publish-java-cdk
|
/approve-and-merge reason="test-only change" |
This PR parallelizes the tests and integration tests for source-postgres using junit's parallelism instead of gradle's. This allows us to start singleton test containers which are shared by all tests. Changing the parallelism forces the removal of the
@SystemStub
annotation which isn't supported in this case; I get around setting env vars by using and extendingFeatureFlags
.The changes to the source-postgres tests are superficial in nature. A lot of the diff consists of lines whose indentation levels were changed. The parts of this PR deserving more scrutiny are in
airbyte-cdk/**
. Note that CI is failing but that's because of this annoying dockerhub rate limit again;airbyte-ci connectors --name=source-postgres test
completes successfully in 7 minutes on my laptop.Fixes #31818.