@@ -64,9 +64,8 @@ public async Task TestBasicRoundtripConcurrent()
6464
6565 var publish1SyncSource = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
6666 var publish2SyncSource = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
67- var maximumWaitTime = TimeSpan . FromSeconds ( 10 ) ;
6867
69- var tokenSource = new CancellationTokenSource ( maximumWaitTime ) ;
68+ var tokenSource = new CancellationTokenSource ( WaitSpan ) ;
7069 CancellationTokenRegistration ctsr = tokenSource . Token . Register ( ( ) =>
7170 {
7271 publish1SyncSource . TrySetResult ( false ) ;
@@ -120,10 +119,10 @@ public async Task TestBasicRoundtripConcurrent()
120119 await AssertRanToCompletion ( publish1SyncSource . Task , publish2SyncSource . Task ) ;
121120
122121 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 } ") ;
124123
125124 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 } ") ;
127126 }
128127 finally
129128 {
@@ -145,8 +144,8 @@ public async Task TestBasicRoundtripConcurrentManyMessages()
145144
146145 var publish1SyncSource = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
147146 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 ) ;
150149 CancellationTokenRegistration ctsr = tokenSource . Token . Register ( ( ) =>
151150 {
152151 publish1SyncSource . TrySetResult ( false ) ;
@@ -234,10 +233,10 @@ public async Task TestBasicRoundtripConcurrentManyMessages()
234233 await AssertRanToCompletion ( publish1SyncSource . Task , publish2SyncSource . Task ) ;
235234
236235 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 } ") ;
238237
239238 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 } ") ;
241240
242241 await consumeChannel . CloseAsync ( ) ;
243242 }
0 commit comments