Skip to content

Commit

Permalink
[INTERNAL] Tests: Fixes ChangeFeedAsync test (#3223)
Browse files Browse the repository at this point in the history
* explicitly calling out type

* Removing time based test
  • Loading branch information
ealsur authored May 26, 2022
1 parent 470d6de commit fcc19be
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ public override void WriteJson(
if (value is DocumentServiceLeaseCore documentServiceLeaseCore)
{
serializer.ContractResolver.ResolveContract(typeof(DocumentServiceLeaseCore)).Converter = null;
serializer.Serialize(writer, documentServiceLeaseCore);
serializer.Serialize(writer, documentServiceLeaseCore, typeof(DocumentServiceLeaseCore));
}

if (value is DocumentServiceLeaseCoreEpk documentServiceLeaseCoreEpk)
{
serializer.ContractResolver.ResolveContract(typeof(DocumentServiceLeaseCoreEpk)).Converter = null;
serializer.Serialize(writer, documentServiceLeaseCoreEpk);
serializer.Serialize(writer, documentServiceLeaseCoreEpk, typeof(DocumentServiceLeaseCoreEpk));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,19 @@ public async Task ChangeFeedAsync()
await processor.StartAsync();

// Letting processor initialize
await Task.Delay(2000);
bool hasLeases = false;
while (!hasLeases)
{
int leases = leaseContainer.GetItemLinqQueryable<JObject>(true).Count();
if (leases > 1)
{
hasLeases = true;
}
else
{
await Task.Delay(1000);
}
}

await processor.StopAsync();

Expand Down

0 comments on commit fcc19be

Please sign in to comment.