Skip to content

Commit

Permalink
Synchronize progress reporting (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
chitsaw authored Mar 19, 2024
1 parent cbdbe25 commit e70842f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Sources/Runtime/Test.Psi/PersistenceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1506,8 +1506,19 @@ public void StoreProgressTest()
readStream.Do(_ => Thread.Sleep(5));
readStream.Do(_ => Thread.Sleep(10));

var progressListLock = new object();

// Capture progress reports
var progressReporter = new Progress<double>(x =>
{
lock (progressListLock)
{
progress.Add(x);
}
});

// replay as fast as possible from store
p2.RunAsync(TimeInterval.Infinite, false, new Progress<double>(x => progress.Add(x)));
p2.RunAsync(TimeInterval.Infinite, false, progressReporter);
p2.WaitAll();
}

Expand Down

0 comments on commit e70842f

Please sign in to comment.