forked from ravendb/ravendb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RavenDB-22634 : add test case (will be skipped for now, since there a…
…re some issues with Mixed Cluster tests)
- Loading branch information
aviv
committed
Aug 19, 2024
1 parent
cf8c440
commit 0203b66
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Raven.Client.Documents; | ||
using Raven.Client.Exceptions; | ||
using Raven.Client.ServerWide; | ||
using Raven.Client.ServerWide.Operations; | ||
using Raven.Client.ServerWide.Sharding; | ||
using Tests.Infrastructure; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace InterversionTests | ||
{ | ||
public class RavenDB_22634 : MixedClusterTestBase | ||
{ | ||
public RavenDB_22634(ITestOutputHelper output) : base(output) | ||
{ | ||
} | ||
|
||
[RavenMultiplatformFact(RavenTestCategory.Interversion | RavenTestCategory.Sharding, RavenPlatform.Windows, Skip = "WIP")] | ||
public async Task MixedCluster_61_and_60_ShouldPreventCreatingDatabaseWithPrefixedSharding() | ||
{ | ||
var (leader, peers, _) = await CreateMixedCluster([ | ||
"6.0.105", | ||
"6.0.105" | ||
]); | ||
|
||
using var leaderStore = new DocumentStore | ||
{ | ||
Urls = [leader.WebUrl, peers[0].Url, peers[1].Url] | ||
}.Initialize(); | ||
|
||
var dbRec = new DatabaseRecord("prefixed-db") | ||
{ | ||
Sharding = new ShardingConfiguration | ||
{ | ||
Shards = new Dictionary<int, DatabaseTopology> | ||
{ | ||
{0, new DatabaseTopology()}, | ||
{1, new DatabaseTopology()}, | ||
{2, new DatabaseTopology()} | ||
}, | ||
Prefixed = [new PrefixedShardingSetting | ||
{ | ||
Prefix = "orders/", | ||
Shards = [2] | ||
}] | ||
} | ||
}; | ||
|
||
var ex = await Assert.ThrowsAsync<RavenException>(async () => | ||
await leaderStore.Maintenance.Server.SendAsync(new CreateDatabaseOperation(dbRec))); | ||
|
||
Assert.Contains("Some nodes in the cluster are running older versions of RavenDB that do not support the Prefixed Sharding feature", ex.Message); | ||
} | ||
} | ||
} |