Skip to content

Commit 75af1dd

Browse files
authored
Merge branch 'master' into ci-coverage
2 parents 31fc4cc + 1cee634 commit 75af1dd

File tree

3 files changed

+43
-17
lines changed

3 files changed

+43
-17
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,14 @@ jobs:
5252
run: sbt --batch mimaReportBinaryIssues
5353

5454
- name: Run tests
55-
continue-on-error: true # results are reported by action-junit-report
5655
run: sbt coverage test
5756

5857
- name: Run integration tests
59-
continue-on-error: true # results are reported by action-junit-report
6058
run: sh ./scripts/run-multijvm-test.sh 1
6159

6260
- name: Publish test report
6361
uses: mikepenz/action-junit-report@v2
62+
if: ${{ always() }}
6463
with:
6564
check_name: ScalaTest Report (Java ${{ matrix.java }})
6665
report_paths: 'target/**test-reports/TEST-*.xml'

src/multi-jvm/scala/lerna/akka/entityreplication/typed/LogReplicationDuringSnapshotSyncSpec.scala

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import akka.util.Timeout
1414
import com.typesafe.config.{ Config, ConfigFactory }
1515
import lerna.akka.entityreplication.util.AtLeastOnceComplete
1616
import lerna.akka.entityreplication.{ STMultiNodeSerializable, STMultiNodeSpec }
17+
import org.scalatest.Ignore
1718

1819
import scala.concurrent.Future
1920
import scala.concurrent.duration._
@@ -30,7 +31,9 @@ object LogReplicationDuringSnapshotSyncSpecConfig extends MultiNodeConfig {
3031

3132
testTransport(true)
3233

33-
private implicit val testKitSettings: TestKitSettings = TestKitSettings(ConfigFactory.load())
34+
private implicit val testKitSettings: TestKitSettings = TestKitSettings(
35+
ConfigFactory.load().getConfig("akka.actor.testkit.typed"),
36+
)
3437

3538
private val testConfig: Config =
3639
ConfigFactory.parseString {
@@ -45,11 +48,7 @@ object LogReplicationDuringSnapshotSyncSpecConfig extends MultiNodeConfig {
4548
raft-actor-auto-start.number-of-actors = 1
4649
4750
sharding {
48-
// Sharding will be available as possible quick.
49-
retry-interval = 500ms
50-
waiting-for-state-timeout = 500ms
51-
updating-state-timeout = 500ms
52-
51+
// drop old messages actively
5352
buffer-size = 50
5453
}
5554
compaction {
@@ -61,8 +60,16 @@ object LogReplicationDuringSnapshotSyncSpecConfig extends MultiNodeConfig {
6160
// This spec requires longer timeouts
6261
akka.actor.testkit.typed.filter-leeway = 30s
6362
akka.testconductor.barrier-timeout = 5m
64-
// This spec don't use the eventsourced feature
65-
lerna.akka.entityreplication.raft.eventsourced.commit-log-store.retry.attempts = 0
63+
64+
akka.cluster.sharding {
65+
// Sharding will be available as possible quick.
66+
retry-interval = 500ms
67+
waiting-for-state-timeout = 500ms
68+
updating-state-timeout = 500ms
69+
distributed-data.majority-min-cap = 2
70+
coordinator-state.write-majority-plus = 0
71+
coordinator-state.read-majority-plus = 0
72+
}
6673
"""
6774
}
6875

@@ -126,12 +133,20 @@ object LogReplicationDuringSnapshotSyncSpecConfig extends MultiNodeConfig {
126133
})
127134
}
128135

129-
class LogReplicationDuringSnapshotSyncSpecMultiJvmController extends LogReplicationDuringSnapshotSyncSpec
130-
class LogReplicationDuringSnapshotSyncSpecMultiJvmNode1 extends LogReplicationDuringSnapshotSyncSpec
131-
class LogReplicationDuringSnapshotSyncSpecMultiJvmNode2 extends LogReplicationDuringSnapshotSyncSpec
132-
class LogReplicationDuringSnapshotSyncSpecMultiJvmNode3 extends LogReplicationDuringSnapshotSyncSpec
133-
class LogReplicationDuringSnapshotSyncSpecMultiJvmNode4 extends LogReplicationDuringSnapshotSyncSpec
134-
136+
// This test is ignored due to that stabilizing this test in a CI environment is difficult.
137+
// To enable this test, remove all @Ignore below:
138+
@Ignore class LogReplicationDuringSnapshotSyncSpecMultiJvmController extends LogReplicationDuringSnapshotSyncSpec
139+
@Ignore class LogReplicationDuringSnapshotSyncSpecMultiJvmNode1 extends LogReplicationDuringSnapshotSyncSpec
140+
@Ignore class LogReplicationDuringSnapshotSyncSpecMultiJvmNode2 extends LogReplicationDuringSnapshotSyncSpec
141+
@Ignore class LogReplicationDuringSnapshotSyncSpecMultiJvmNode3 extends LogReplicationDuringSnapshotSyncSpec
142+
@Ignore class LogReplicationDuringSnapshotSyncSpecMultiJvmNode4 extends LogReplicationDuringSnapshotSyncSpec
143+
144+
/**
145+
* This test doesn't verify specific features but reproduces a specific fault.
146+
*
147+
* This test verifies that the committed events don't disappear even if new events are produced by entities
148+
* while only the leader and the member synchronizing the snapshot exist.
149+
*/
135150
class LogReplicationDuringSnapshotSyncSpec
136151
extends MultiNodeSpec(LogReplicationDuringSnapshotSyncSpecConfig)
137152
with STMultiNodeSpec {
@@ -200,7 +215,7 @@ class LogReplicationDuringSnapshotSyncSpec
200215
"LogReplicationDuringSnapshotSyncSpec" should {
201216

202217
"elect node1 as a leader" in {
203-
newCluster(controller, node1, node2, node3)
218+
newCluster(node1, node2, node3)
204219
runOn(node1) {
205220
expectNewLeaderElected {
206221
clusterReplication.init(Register(typedSystem))

src/test/resources/akka-entity-replication-with-cassandra.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ akka-entity-replication.raft.persistence.cassandra = ${akka.persistence.cassandr
3030
keyspace = "entity_replication"
3131
}
3232

33+
query {
34+
// Profile to use.
35+
// See https://docs.datastax.com/en/developer/java-driver/latest/manual/core/configuration/ for overriding any settings
36+
read-profile = "akka-entity-replication-profile"
37+
}
38+
3339
snapshot {
3440

3541
// Profile to use.
@@ -84,6 +90,12 @@ akka-entity-replication.eventsourced.persistence.cassandra = ${akka.persistence.
8490
}
8591
}
8692

93+
query {
94+
// Profile to use.
95+
// See https://docs.datastax.com/en/developer/java-driver/latest/manual/core/configuration/ for overriding any settings
96+
read-profile = "akka-entity-replication-profile"
97+
}
98+
8799
snapshot {
88100

89101
// Profile to use.

0 commit comments

Comments
 (0)