Skip to content

Commit

Permalink
Try to fix a sporadic test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed May 13, 2019
1 parent 69c21e9 commit ffc0d1d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Tests/Realm.Tests/Sync/SyncTestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ public static async Task<FullSyncConfiguration> GetIntegrationConfigAsync(string
EventHandler<ErrorEventArgs> handler = null;
handler = new EventHandler<ErrorEventArgs>((sender, e) =>
{
if (!(e.Exception is T))
{
return;
}
try
{
Assert.That(sender, Is.TypeOf<Session>());
Expand All @@ -139,7 +144,7 @@ public static async Task<FullSyncConfiguration> GetIntegrationConfigAsync(string

session.SimulateError(code, message);

return tcs.Task;
return tcs.Task.Timeout(2000);
}

public static Task WaitForUploadAsync(Realm realm) => WaitForSyncAsync(realm, upload: true, download: false);
Expand Down

0 comments on commit ffc0d1d

Please sign in to comment.