From 87c8f5b1ff2a008dc1cc151c9340ba4fcd170ee6 Mon Sep 17 00:00:00 2001 From: Marcin Lewandowski Date: Wed, 24 Jul 2024 08:12:03 +0200 Subject: [PATCH 1/6] ability to use any RavenDB server version when dispatching github action --- .github/workflows/RavenClient.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/RavenClient.yml b/.github/workflows/RavenClient.yml index 48bea1a0..41c410ef 100644 --- a/.github/workflows/RavenClient.yml +++ b/.github/workflows/RavenClient.yml @@ -7,6 +7,12 @@ on: branches: [ v5.4 ] pull_request: branches: [ v5.4 ] + workflow_dispatch: + inputs: + ravendb_version: + description: 'RavenDB Version' + required: true + type: string jobs: build: @@ -35,7 +41,12 @@ jobs: java-version: ${{ matrix.java-version }} - name: Download RavenDB Server - run: wget -O RavenDB.tar.bz2 "https://hibernatingrhinos.com/downloads/RavenDB%20for%20Linux%20x64/latest?buildType=${{ env.RAVENDB_BUILD_TYPE }}&version=${{ matrix.serverVersion }}" + run: | + if [[ -n "${{ inputs.ravendb_version }}" ]]; then + wget -O RavenDB.tar.bz2 "https://daily-builds.s3.amazonaws.com/RavenDB-${{ inputs.ravendb_version }}-linux-x64.tar.bz2" + else + wget -O RavenDB.tar.bz2 "https://hibernatingrhinos.com/downloads/RavenDB%20for%20Linux%20x64/latest?buildType=${{ env.RAVENDB_BUILD_TYPE }}&version=${{ matrix.serverVersion }}" + fi - run: mkdir certs - run: openssl genrsa -traditional -out certs/ca.key 2048 From 54d2b7944268174418d5412e90ba3d44e6905528 Mon Sep 17 00:00:00 2001 From: Marcin Lewandowski Date: Mon, 26 Aug 2024 12:19:02 +0200 Subject: [PATCH 2/6] tuning flacky test --- .../client/test/server/replication/PullReplicationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java b/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java index e79851e1..05fdc5b4 100644 --- a/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java +++ b/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java @@ -261,7 +261,7 @@ public void disablePullReplicationOnSink() throws Exception { try (DocumentStore sink = getDocumentStore()) { try (DocumentStore hub = getDocumentStore()) { String definitionName = "pull-replication " + hub.getDatabase(); - int timeout = 3_000; + int timeout = 15_000; hub.maintenance().forDatabase(hub.getDatabase()) .send(new PutPullReplicationAsHubOperation(definitionName)); @@ -286,7 +286,7 @@ public void disablePullReplicationOnSink() throws Exception { main.saveChanges(); } - assertThat(waitForDocumentToReplicate(sink, User.class, "hub/2", timeout)) + assertThat(waitForDocumentToReplicate(sink, User.class, "hub/2", timeout / 3)) .isNull(); pull.setDisabled(false); From 4797e532e96ba2f4df082566cfdc4e3a833ebc60 Mon Sep 17 00:00:00 2001 From: Marcin Lewandowski Date: Mon, 26 Aug 2024 13:06:11 +0200 Subject: [PATCH 3/6] tuning flacky test --- .../client/test/server/replication/PullReplicationTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java b/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java index 05fdc5b4..b566defb 100644 --- a/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java +++ b/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java @@ -171,7 +171,7 @@ public void updatePullReplicationOnSink() throws Exception { String definitionName1 = "pull-replication " + hub.getDatabase(); String definitionName2 = "pull-replication " + hub2.getDatabase(); - int timeout = 3_000; + int timeout = 15_000; hub.maintenance().forDatabase(hub.getDatabase()).send(new PutPullReplicationAsHubOperation(definitionName1)); hub2.maintenance().forDatabase(hub2.getDatabase()).send(new PutPullReplicationAsHubOperation(definitionName2)); @@ -281,6 +281,8 @@ public void disablePullReplicationOnSink() throws Exception { addWatcherToReplicationTopology(sink, pull, hub.getUrls()); + Thread.sleep(500); // wait a bit to process updates + try (IDocumentSession main = hub.openSession()) { main.store(new User(), "hub/2"); main.saveChanges(); @@ -292,6 +294,8 @@ public void disablePullReplicationOnSink() throws Exception { pull.setDisabled(false); addWatcherToReplicationTopology(sink, pull, hub.getUrls()); + Thread.sleep(500); // wait a bit to process updates + try (IDocumentSession main = hub.openSession()) { main.store(new User(), "hub/3"); main.saveChanges(); From 4c873bfaa18891b6bc4bd7b40584378665c1677e Mon Sep 17 00:00:00 2001 From: Marcin Lewandowski Date: Mon, 26 Aug 2024 14:11:08 +0200 Subject: [PATCH 4/6] tuning flacky test --- .../client/test/server/replication/PullReplicationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java b/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java index b566defb..d148db96 100644 --- a/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java +++ b/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java @@ -189,7 +189,7 @@ public void updatePullReplicationOnSink() throws Exception { addWatcherToReplicationTopology(sink, pull, hub2.getUrls()); - Thread.sleep(500); // wait a bit to process updates + Thread.sleep(5000); // wait a bit to process updates try (IDocumentSession main = hub.openSession()) { main.store(new User(), "hub1/2"); @@ -281,7 +281,7 @@ public void disablePullReplicationOnSink() throws Exception { addWatcherToReplicationTopology(sink, pull, hub.getUrls()); - Thread.sleep(500); // wait a bit to process updates + Thread.sleep(5000); // wait a bit to process updates try (IDocumentSession main = hub.openSession()) { main.store(new User(), "hub/2"); From 79271bc27d6fc8caa271850bf16a31159dec6458 Mon Sep 17 00:00:00 2001 From: Marcin Lewandowski Date: Mon, 26 Aug 2024 14:24:01 +0200 Subject: [PATCH 5/6] tuning flacky test --- .../client/test/server/replication/PullReplicationTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java b/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java index d148db96..f7546cdb 100644 --- a/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java +++ b/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java @@ -185,6 +185,7 @@ public void updatePullReplicationOnSink() throws Exception { waitForDocumentToReplicate(sink, User.class,"hub1/1", timeout); PullReplicationAsSink pull = new PullReplicationAsSink(hub2.getDatabase(), "ConnectionString2-" + sink.getDatabase(), definitionName2); + pull.setUrl(sink.getUrls()[0]); pull.setTaskId(pullTasks.get(0).getTaskId()); addWatcherToReplicationTopology(sink, pull, hub2.getUrls()); @@ -277,6 +278,7 @@ public void disablePullReplicationOnSink() throws Exception { PullReplicationAsSink pull = new PullReplicationAsSink(hub.getDatabase(), "ConnectionString-" + sink.getDatabase(), definitionName); pull.setDisabled(true); + pull.setUrl(sink.getUrls()[0]); pull.setTaskId(pullTasks.get(0).getTaskId()); addWatcherToReplicationTopology(sink, pull, hub.getUrls()); @@ -386,6 +388,7 @@ public List setupPullReplication(String remoteName, Doc for (DocumentStore store : hub) { PullReplicationAsSink pull = new PullReplicationAsSink(store.getDatabase(), "ConnectionString-" + store.getDatabase(), remoteName); + pull.setUrl(sink.getUrls()[0]); modifyReplicationDestination(pull); resList.add(addWatcherToReplicationTopology(sink, pull, store.getUrls())); } From 9423a4185807e7918a0bdd7c25d9bff4ef84fb24 Mon Sep 17 00:00:00 2001 From: Marcin Lewandowski Date: Mon, 26 Aug 2024 15:17:00 +0200 Subject: [PATCH 6/6] tuning flacky test --- .../client/test/server/replication/PullReplicationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java b/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java index f7546cdb..4494f56e 100644 --- a/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java +++ b/src/test/java/net/ravendb/client/test/server/replication/PullReplicationTest.java @@ -190,7 +190,7 @@ public void updatePullReplicationOnSink() throws Exception { addWatcherToReplicationTopology(sink, pull, hub2.getUrls()); - Thread.sleep(5000); // wait a bit to process updates + Thread.sleep(500); // wait a bit to process updates try (IDocumentSession main = hub.openSession()) { main.store(new User(), "hub1/2"); @@ -283,7 +283,7 @@ public void disablePullReplicationOnSink() throws Exception { addWatcherToReplicationTopology(sink, pull, hub.getUrls()); - Thread.sleep(5000); // wait a bit to process updates + Thread.sleep(500); // wait a bit to process updates try (IDocumentSession main = hub.openSession()) { main.store(new User(), "hub/2");