Skip to content

Commit c1158a7

Browse files
Fix Test: StoplisteningDuringActiveConnectionAttempts
To reflect Copilot's suggestion microsoft#1825 (comment) and cancelation request will break test with new introduced catch blcok
1 parent 8cededb commit c1158a7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

test/standalone/Garnet.test/GarnetServerTcpTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,16 @@ public async Task StopListeningDuringActiveConnectionAttempts()
9898
await redis.GetDatabase(0).PingAsync();
9999
await Task.Delay(10);
100100
}
101+
catch (OperationCanceledException) when (cts.Token.IsCancellationRequested)
102+
{
103+
break;
104+
}
101105
catch
102106
{
103107
// Connection failures are expected after StopListening
104108
}
105109
}
106-
}, cts.Token));
110+
}));
107111
}
108112

109113
await Task.Delay(50); // Let some connections establish

0 commit comments

Comments
 (0)