Skip to content

Commit

Permalink
Fix flaky postgres tests (#4234)
Browse files Browse the repository at this point in the history
* Fix master build.
---------

Co-authored-by: filipe <flautert@liquibase.org>
Co-authored-by: Wesley Willard <wwillard@datical.com>
  • Loading branch information
3 people committed May 8, 2023
1 parent 60bcd29 commit 47c4e50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ CREATE TABLE $tableName ( product_no varchar(20) DEFAULT nextval('$sequenceName'
commandScope.execute()
def generatedChangelog = new File(changelogfile)
def generatedChangelogContents = FileUtil.getContents(generatedChangelog)
generatedChangelogContents.contains("""CREATE SEQUENCE IF NOT EXISTS "public"."${sequenceName.toLowerCase()}";""")
generatedChangelogContents.contains("""CREATE SEQUENCE IF NOT EXISTS "public"."${sequenceName.toLowerCase()}" AS bigint START WITH 100 INCREMENT BY 5 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1;""")
generatedChangelogContents.contains("""CREATE TABLE "public"."${tableName.toLowerCase()}" ("product_no" VARCHAR(20) DEFAULT 'nextval(''''${sequenceName.toLowerCase()}''''::regclass)');""")

cleanup:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ public void resetAvailableDatabases() throws Exception {
connection.commit();

if (database.supportsSchemas()) {
try {
database.dropDatabaseObjects(new CatalogAndSchema(null, testSystem.getAltSchema()));
} catch (DatabaseException e) {
//ok
}
connection.commit();

try {
Expand Down

0 comments on commit 47c4e50

Please sign in to comment.