Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
111175: roachtest: fix flowable roachtest r=rafiss a=rafiss

It no longer works with Java 8. Also, the test had decayed so requires some other fixes.

fixes #111032
backports will fix:
- #111029
- #111027
- #111102

Release note: None

111282: rangefeed: fix client side tests flakiness r=erikgrinaker a=aliher1911

kvclient rangefeed tests validate fixed sequence of events. This is much stricter than what rangefeed guarantees. Recent changes made rangefeeds restart internally more frequently which causes tests to fail.
This commit disables potential rangefeed restarts to make tests work until new data driven test suite is merged.

Epic: none
Fixes: #111161

Release note: None

Co-authored-by: Rafi Shamim <[email protected]>
Co-authored-by: Oleg Afanasyev <[email protected]>
  • Loading branch information
3 people committed Sep 26, 2023
3 parents 695eaf6 + e4c25ae + 046259a commit 96c0868
Show file tree
Hide file tree
Showing 2 changed files with 156 additions and 32 deletions.
78 changes: 75 additions & 3 deletions pkg/cmd/roachtest/tests/flowable.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package tests

import (
"context"
"fmt"
"regexp"

"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/cluster"
Expand Down Expand Up @@ -39,6 +40,29 @@ func registerFlowable(r registry.Registry) {
c.Put(ctx, t.Cockroach(), "./cockroach", c.All())
c.Start(ctx, t.L(), option.DefaultStartOpts(), install.MakeClusterSettings(), c.All())

t.Status("creating database used by tests")
db, err := c.ConnE(ctx, t.L(), node[0])
if err != nil {
t.Fatal(err)
}
defer db.Close()

if _, err := db.ExecContext(
ctx, `CREATE DATABASE flowable;`,
); err != nil {
t.Fatal(err)
}
if _, err := db.ExecContext(
ctx, `CREATE USER flowable;`,
); err != nil {
t.Fatal(err)
}
if _, err := db.ExecContext(
ctx, `GRANT admin TO flowable;`,
); err != nil {
t.Fatal(err)
}

t.Status("cloning flowable and installing prerequisites")
latestTag, err := repeatGetLatestTag(
ctx, t, "flowable", "flowable-engine", flowableReleaseTagRegex,
Expand All @@ -60,7 +84,7 @@ func registerFlowable(r registry.Registry) {
c,
node,
"install dependencies",
`sudo apt-get -qq install default-jre openjdk-8-jdk-headless gradle maven`,
`sudo apt-get -qq install default-jre openjdk-17-jdk-headless gradle maven`,
); err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -90,13 +114,32 @@ func registerFlowable(r registry.Registry) {
c,
node,
"building Flowable",
`cd /mnt/data1/flowable-engine/ && mvn clean install -DskipTests`,
`cd /mnt/data1/flowable-engine/ && ./mvnw clean install -DskipTests`,
); err != nil {
t.Fatal(err)
}

if err := repeatRunE(
ctx,
t,
c,
node,
"configuring tests for cockroachdb",
fmt.Sprintf(`mkdir -p $HOME/.flowable/jdbc/ && \
echo "%s" > $HOME/.flowable/jdbc/build.flowable6.cockroachdb.properties && \
cd /mnt/data1/flowable-engine/ && \
echo '%s' > flowable_crdb.patch && \
git apply --ignore-whitespace flowable_crdb.patch && \
grep "force-commit" . -lr | xargs sed -i 's/-- force-commit//g'`,
flowableParams, flowablePatch,
),
); err != nil {
t.Fatal(err)
}

if err := c.RunE(ctx, node,
`cd /mnt/data1/flowable-engine/ && mvn clean test -Dtest=Flowable6Test#testLongServiceTaskLoop -Ddb=crdb`,
`cd /mnt/data1/flowable-engine/ && \
./mvnw clean test -Dtest=Flowable6Test#testLongServiceTaskLoop -Ddatabase=cockroachdb`,
); err != nil {
t.Fatal(err)
}
Expand All @@ -114,3 +157,32 @@ func registerFlowable(r registry.Registry) {
},
})
}

const flowableParams = `
jdbc.url=jdbc:postgresql://127.0.0.1:26257/flowable?sslmode=disable
jdbc.driver=org.postgresql.Driver
jdbc.username=flowable
jdbc.password
`

// This patch will not be needed once https://github.com/flowable/flowable-engine/pull/3752
// is merged.
const flowablePatch = `
diff --git a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/persistence/entity/TableDataManagerImpl.java b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/persistence/entity/TableDataManagerImpl.java
index 38a332b785..620ed787bf 100644
--- a/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/persistence/entity/TableDataManagerImpl.java
+++ b/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/persistence/entity/TableDataManagerImpl.java
@@ -101,6 +101,12 @@ public class TableDataManagerImpl implements TableDataManager {
List<String> tableNames = new ArrayList<>();
try (ResultSet tables = databaseMetaData.getTables(catalog, schema, tableNameFilter, DbSqlSession.JDBC_METADATA_TABLE_TYPES)) {
while (tables.next()) {
+ if ("cockroachdb".equals(getDbSqlSession().getDbSqlSessionFactory().getDatabaseType())) {
+ String schemaName = tables.getString("TABLE_SCHEM");
+ if ("crdb_internal".equals(schemaName)) {
+ continue;
+ }
+ }
String tableName = tables.getString("TABLE_NAME");
tableName = tableName.toUpperCase(Locale.ROOT);
tableNames.add(tableName);
`
Loading

0 comments on commit 96c0868

Please sign in to comment.