Skip to content

Commit 9315ff5

Browse files
committed
fixed the unit test TestCustomCloseReason
1 parent e3f650c commit 9315ff5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎test/SuperSocket.Tests/MainTest.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public async Task TestConnectionType(Type hostConfiguratorType, Type connectionT
364364
using (var socket = CreateClient(hostConfigurator))
365365
using (var socketStream = await hostConfigurator.GetClientStream(socket))
366366
{
367-
resetEvent.WaitOne(5000);
367+
Assert.True(resetEvent.WaitOne(5000));
368368
}
369369

370370
await server.StopAsync();

‎test/SuperSocket.Tests/SessionTest.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public async Task TestCustomCloseReason(Type hostConfiguratorType, int closeReas
227227

228228
CloseReason closeReason = CloseReason.Unknown;
229229

230-
var resetEvent = new AutoResetEvent(true);
230+
var resetEvent = new AutoResetEvent(false);
231231

232232
using (var server = CreateSocketServerBuilder<TextPackageInfo, LinePipelineFilter>(hostConfigurator)
233233
.ConfigureAppConfiguration((HostBuilder, configBuilder) =>
@@ -260,7 +260,7 @@ public async Task TestCustomCloseReason(Type hostConfiguratorType, int closeReas
260260
using (var socket = CreateClient(hostConfigurator))
261261
using (var socketStream = await hostConfigurator.GetClientStream(socket))
262262
{
263-
resetEvent.WaitOne(1000);
263+
Assert.True(resetEvent.WaitOne(1000));
264264

265265
// LocalClosing
266266
closeReason = CloseReason.Unknown;
@@ -269,7 +269,7 @@ public async Task TestCustomCloseReason(Type hostConfiguratorType, int closeReas
269269

270270
await session.CloseAsync(closeReasonRequested);
271271

272-
resetEvent.WaitOne(1000);
272+
Assert.True(resetEvent.WaitOne(1000));
273273

274274
Assert.Equal(SessionState.Closed, session.State);
275275
Assert.Equal(closeReasonRequested, closeReason);

0 commit comments

Comments
 (0)