@@ -64,9 +64,8 @@ public async Task TestBasicRoundtripConcurrent()
64
64
65
65
var publish1SyncSource = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
66
66
var publish2SyncSource = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
67
- var maximumWaitTime = TimeSpan . FromSeconds ( 10 ) ;
68
67
69
- var tokenSource = new CancellationTokenSource ( maximumWaitTime ) ;
68
+ var tokenSource = new CancellationTokenSource ( WaitSpan ) ;
70
69
CancellationTokenRegistration ctsr = tokenSource . Token . Register ( ( ) =>
71
70
{
72
71
publish1SyncSource . TrySetResult ( false ) ;
@@ -120,10 +119,10 @@ public async Task TestBasicRoundtripConcurrent()
120
119
await AssertRanToCompletion ( publish1SyncSource . Task , publish2SyncSource . Task ) ;
121
120
122
121
bool result1 = await publish1SyncSource . Task ;
123
- Assert . True ( result1 , $ "1 - Non concurrent dispatch lead to deadlock after { maximumWaitTime } ") ;
122
+ Assert . True ( result1 , $ "1 - Non concurrent dispatch lead to deadlock after { WaitSpan } ") ;
124
123
125
124
bool result2 = await publish2SyncSource . Task ;
126
- Assert . True ( result2 , $ "2 - Non concurrent dispatch lead to deadlock after { maximumWaitTime } ") ;
125
+ Assert . True ( result2 , $ "2 - Non concurrent dispatch lead to deadlock after { WaitSpan } ") ;
127
126
}
128
127
finally
129
128
{
@@ -145,8 +144,8 @@ public async Task TestBasicRoundtripConcurrentManyMessages()
145
144
146
145
var publish1SyncSource = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
147
146
var publish2SyncSource = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
148
- var maximumWaitTime = TimeSpan . FromSeconds ( 30 ) ;
149
- var tokenSource = new CancellationTokenSource ( maximumWaitTime ) ;
147
+
148
+ var tokenSource = new CancellationTokenSource ( WaitSpan ) ;
150
149
CancellationTokenRegistration ctsr = tokenSource . Token . Register ( ( ) =>
151
150
{
152
151
publish1SyncSource . TrySetResult ( false ) ;
@@ -234,10 +233,10 @@ public async Task TestBasicRoundtripConcurrentManyMessages()
234
233
await AssertRanToCompletion ( publish1SyncSource . Task , publish2SyncSource . Task ) ;
235
234
236
235
bool result1 = await publish1SyncSource . Task ;
237
- Assert . True ( result1 , $ "Non concurrent dispatch lead to deadlock after { maximumWaitTime } ") ;
236
+ Assert . True ( result1 , $ "Non concurrent dispatch lead to deadlock after { WaitSpan } ") ;
238
237
239
238
bool result2 = await publish2SyncSource . Task ;
240
- Assert . True ( result2 , $ "Non concurrent dispatch lead to deadlock after { maximumWaitTime } ") ;
239
+ Assert . True ( result2 , $ "Non concurrent dispatch lead to deadlock after { WaitSpan } ") ;
241
240
242
241
await consumeChannel . CloseAsync ( ) ;
243
242
}
0 commit comments