Skip to content

Commit

Permalink
Update Akka.NET and Akka.Hosting to 1.5.0-beta6 (#239)
Browse files Browse the repository at this point in the history
* [bug] `object.Message.Match()`

* [fix] remove `Match()`

* [Obsolete] `protected override void Dispose(bool disposing)`

* Revert "[Obsolete] `protected override void Dispose(bool disposing)`"

This reverts commit 2565837.

* Update Akka.NET 1.5.0-beta6
- change `Dispose(bool disposing)` to `AfterAll()`

* Roll back docker image tag to 6.0.13

It seems like the fixture class isn't compatible with Redis 7.x

* Fix fixture class

---------

Co-authored-by: Gregorius Soedharmo <arkatufus@yahoo.com>
  • Loading branch information
eaba and Arkatufus authored Mar 2, 2023
1 parent 3b29310 commit bfcfe63
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public RedisCurrentEventsByPersistenceIdSpec(ITestOutputHelper output, RedisClus
ReadJournal = Sys.ReadJournalFor<RedisReadJournal>(RedisReadJournal.Identifier);
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
DbUtils.Clean();
base.Dispose(disposing);
base.AfterAll();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public RedisEventsByPersistenceIdSpec(ITestOutputHelper output, RedisClusterFixt
ReadJournal = Sys.ReadJournalFor<RedisReadJournal>(RedisReadJournal.Identifier);
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
DbUtils.Clean();
base.Dispose(disposing);
base.AfterAll();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public RedisClusterFixture()
}

protected string ImageName => "grokzen/redis-cluster";
protected string Tag => "latest";
protected string Tag => "6.0.13";
protected string RedisImageName => $"{ImageName}:{Tag}";

public string ConnectionString { get; private set; }
Expand All @@ -55,7 +55,7 @@ public async Task InitializeAsync()
});
if (images.Count == 0)
await Client.Images.CreateImageAsync(
new ImagesCreateParameters {FromImage = RedisImageName, Tag = "latest"}, null,
new ImagesCreateParameters {FromImage = RedisImageName, Tag = Tag}, null,
new Progress<JSONMessage>(message =>
{
Console.WriteLine(!string.IsNullOrEmpty(message.ErrorMessage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public RedisJournalDefaultDatabaseSpec(ITestOutputHelper output, RedisClusterFix

protected override bool SupportsRejectingNonSerializableObjects { get; } = false;

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public RedisJournalPerfSpec(ITestOutputHelper output, RedisClusterFixture fixtur
{
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Akka.Persistence.Redis.Cluster.Tests/RedisJournalSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public RedisJournalSpec(ITestOutputHelper output, RedisClusterFixture fixture)

protected override bool SupportsRejectingNonSerializableObjects { get; } = false;

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public RedisSnapshotStoreDefaultDatabaseSpec(ITestOutputHelper output, RedisClus
Initialize();
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public RedisSnapshotStoreSpec(ITestOutputHelper output, RedisClusterFixture fixt
Initialize();
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public override void Journal_should_serialize_Persistent_with_EventAdapter_manif
{
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public RedisSnapshotStoreSerializationSpec(ITestOutputHelper output, RedisCluste
{
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public RedisCurrentEventsByPersistenceIdSpec(ITestOutputHelper output, RedisFixt
ReadJournal = Sys.ReadJournalFor<RedisReadJournal>(RedisReadJournal.Identifier);
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
DbUtils.Clean(Database);
base.Dispose(disposing);
base.AfterAll();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public RedisEventsByPersistenceIdSpec(ITestOutputHelper output, RedisFixture fix
ReadJournal = Sys.ReadJournalFor<RedisReadJournal>(RedisReadJournal.Identifier);
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
DbUtils.Clean(Database);
base.Dispose(disposing);
base.AfterAll();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public RedisJournalDefaultDatabaseSpec(ITestOutputHelper output, RedisFixture fi

protected override bool SupportsRejectingNonSerializableObjects { get; } = false;

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean(Database);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Akka.Persistence.Redis.Tests/RedisJournalPerfSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public RedisJournalPerfSpec(ITestOutputHelper output, RedisFixture fixture) : ba
{
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean(Database);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Akka.Persistence.Redis.Tests/RedisJournalSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public RedisJournalSpec(ITestOutputHelper output, RedisFixture fixture) : base(C

protected override bool SupportsRejectingNonSerializableObjects { get; } = false;

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean(Database);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public RedisSnapshotStoreDefaultDatabaseSpec(ITestOutputHelper output, RedisFixt
Initialize();
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean(Database);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Akka.Persistence.Redis.Tests/RedisSnapshotStoreSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public RedisSnapshotStoreSpec(ITestOutputHelper output, RedisFixture fixture)
Initialize();
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean(Database);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public override void Journal_should_serialize_Persistent_with_EventAdapter_manif
{
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean(Database);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public RedisSnapshotStoreSerializationSpec(ITestOutputHelper output, RedisFixtur
{
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean(Database);
}
}
Expand Down
17 changes: 12 additions & 5 deletions src/Akka.Persistence.Redis/Query/EventsByPersistenceIdPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,18 @@ protected override bool Receive(object message)

protected bool Init(object message)
{
return message.Match()
.With<EventsByPersistenceIdPublisher.Continue>(() => { })
.With<Request>(_ => ReceiveInitialRequest())
.With<Cancel>(_ => Context.Stop(Self))
.WasHandled;
switch (message)
{
case EventsByPersistenceIdPublisher.Continue _:
return true;
case Request _:
ReceiveInitialRequest();
return true;
case Cancel _:
Context.Stop(Self);
return true;
}
return false;
}

protected bool Idle(object message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public void PersistenceActor_Must_measure_PersistGroup1000()
RunGroupBenchmark(1000, 10);
}

protected override void Dispose(bool disposing)
protected override void AfterAll()
{
base.Dispose(disposing);
base.AfterAll();
DbUtils.Clean(Database);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Other Changes**
</PropertyGroup>
<PropertyGroup>
<XunitVersion>2.4.2</XunitVersion>
<TestSdkVersion>17.4.0</TestSdkVersion>
<AkkaVersion>1.4.49</AkkaVersion>
<TestSdkVersion>17.5.0</TestSdkVersion>
<AkkaVersion>1.5.0-beta6</AkkaVersion>
<RedisVersion>2.6.86</RedisVersion>
<DockerVersion>3.125.12</DockerVersion>
<NetCoreTestVersion>netcoreapp3.1</NetCoreTestVersion>
Expand Down

0 comments on commit bfcfe63

Please sign in to comment.