@@ -176,9 +176,10 @@ protected Task WhenTaskCompletes(Task task)
176176 return task . WaitAsync ( _waitSpan ) ;
177177 }
178178
179- protected static async Task WaitUntilStable < T > ( Func < T > getValue , T ? stableValue = default )
179+ protected static async Task WaitUntilStableAsync < T > ( Func < T > getValue , T ? stableValue = default )
180180 where T : IEquatable < T >
181181 {
182+ DateTime start = DateTime . Now ;
182183 const int iterations = 20 ;
183184 int iteration = 0 ;
184185 T val0 ;
@@ -198,13 +199,16 @@ protected static async Task WaitUntilStable<T>(Func<T> getValue, T? stableValue
198199
199200 if ( iteration == iterations )
200201 {
201- Assert . Fail ( $ "value did not stabilize as expected (stableValue: { stableValue } )") ;
202+ DateTime stop = DateTime . Now ;
203+ TimeSpan duration = stop - start ;
204+ Assert . Fail ( $ "value did not stabilize as expected within '{ duration } ' (stableValue: { stableValue } )") ;
202205 }
203206 }
204207
205- protected static async Task WaitUntilStable < T > ( Func < Task < T > > getValue , T ? stableValue = default )
208+ protected static async Task WaitUntilStableAsync < T > ( Func < Task < T > > getValue , T ? stableValue = default )
206209 where T : IEquatable < T >
207210 {
211+ DateTime start = DateTime . Now ;
208212 const int iterations = 20 ;
209213 int iteration = 0 ;
210214 T val0 ;
@@ -224,7 +228,9 @@ protected static async Task WaitUntilStable<T>(Func<Task<T>> getValue, T? stable
224228
225229 if ( iteration == iterations )
226230 {
227- Assert . Fail ( $ "value did not stabilize as expected (stableValue: { stableValue } )") ;
231+ DateTime stop = DateTime . Now ;
232+ TimeSpan duration = stop - start ;
233+ Assert . Fail ( $ "value did not stabilize as expected within '{ duration } ' (stableValue: { stableValue } )") ;
228234 }
229235 }
230236
0 commit comments