@@ -11,6 +11,7 @@ namespace StackExchange.Redis.Tests;
1111/// When a MOVED error points to the same endpoint, the client should reconnect before retrying,
1212/// allowing the DNS record/proxy/load balancer to route to a different underlying server host.
1313/// </summary>
14+ [ RunPerProtocol ]
1415public class MovedUnitTests ( ITestOutputHelper log )
1516{
1617 private RedisKey Me ( [ CallerMemberName ] string callerName = "" ) => callerName ;
@@ -48,13 +49,16 @@ public async Task CrossSlotDisallowed(ServerType serverType)
4849 }
4950
5051 [ Theory ]
51- [ InlineData ( true ) ]
52- [ InlineData ( false ) ]
53- public async Task KeyMigrationFollowed ( bool allowFollowRedirects )
52+ [ InlineData ( true , false ) ]
53+ [ InlineData ( false , false ) ]
54+ [ InlineData ( true , true ) ]
55+ [ InlineData ( false , true ) ]
56+ public async Task KeyMigrationFollowed ( bool allowFollowRedirects , bool toNewUnknownNode )
5457 {
5558 RedisKey key = Me ( ) ;
5659 using var server = new InProcessTestServer ( log ) { ServerType = ServerType . Cluster } ;
57- var secondNode = server . AddEmptyNode ( ) ;
60+ // depending on the test, we might not want the client to know about the second node yet
61+ var secondNode = toNewUnknownNode ? null : server . AddEmptyNode ( ) ;
5862
5963 await using var muxer = await server . ConnectAsync ( ) ;
6064 var db = muxer . GetDatabase ( ) ;
@@ -63,6 +67,11 @@ public async Task KeyMigrationFollowed(bool allowFollowRedirects)
6367 var value = await db . StringGetAsync ( key ) ;
6468 Assert . Equal ( "value" , ( string ? ) value ) ;
6569
70+ if ( toNewUnknownNode ) // if deferred, the client doesn't know about this yet
71+ {
72+ secondNode = server . AddEmptyNode ( ) ;
73+ }
74+
6675 server . Migrate ( key , secondNode ) ;
6776
6877 if ( allowFollowRedirects )
0 commit comments