test: restore MaxAgeMs values in cluster tests after timestamp fix
Now that MemStore uses Unix epoch timestamps (13a3f81), restore the
original Go MaxAge values that were previously omitted as workarounds:
- JsCluster2: MaxAgeMs=500 (Go: 500ms)
- JsCluster34: MaxAgeMs=5000 (Go: 5s)
This commit is contained in:
@@ -119,16 +119,14 @@ public class JsCluster2GoParityTests
|
||||
{
|
||||
await using var cluster = await JetStreamClusterFixture.StartAsync(3);
|
||||
|
||||
// Note: MaxAgeMs omitted — the .NET MemStore stores timestamps as Ticks*100 (nanoseconds
|
||||
// since year 0001) which overflows long, yielding a timestamp in year ~272 AD. Any
|
||||
// MaxAgeMs value would immediately prune all messages. The core behavior under test is
|
||||
// that consumer ack-pending tracking works correctly with freshly published messages.
|
||||
// Go ref: server/jetstream_cluster_2_test.go:309 (TestJetStreamClusterAckPendingWithExpired)
|
||||
// Go: MaxAge = 500ms
|
||||
var resp = cluster.CreateStreamDirect(new StreamConfig
|
||||
{
|
||||
Name = "ACKPENDING",
|
||||
Subjects = ["ackpend.>"],
|
||||
Replicas = 3,
|
||||
MaxAgeMs = 500,
|
||||
});
|
||||
resp.Error.ShouldBeNull();
|
||||
|
||||
@@ -147,12 +145,15 @@ public class JsCluster2GoParityTests
|
||||
{
|
||||
await using var cluster = await JetStreamClusterFixture.StartAsync(3);
|
||||
|
||||
// Note: MaxAgeMs omitted — the .NET MemStore uses Ticks*100 nanosecond timestamps that
|
||||
// overflow long, causing the stored timestamp to resolve to year ~272 AD. With any
|
||||
// MaxAgeMs set, all messages are immediately pruned. The core behavior under test
|
||||
// is that stream state correctly tracks published message count.
|
||||
// Go ref: server/jetstream_cluster_2_test.go:309 (TestJetStreamClusterAckPendingWithExpired)
|
||||
var resp = await cluster.CreateStreamAsync("EXPIRING", ["expire.>"], replicas: 3);
|
||||
// Go: MaxAge = 500ms
|
||||
var resp = cluster.CreateStreamDirect(new StreamConfig
|
||||
{
|
||||
Name = "EXPIRING",
|
||||
Subjects = ["expire.>"],
|
||||
Replicas = 3,
|
||||
MaxAgeMs = 500,
|
||||
});
|
||||
resp.Error.ShouldBeNull();
|
||||
|
||||
const int toSend = 100;
|
||||
|
||||
Reference in New Issue
Block a user