Skip to content

Commit

Permalink
Really Adding detection for transient generation of invalid json in C…
Browse files Browse the repository at this point in the history
…hangeFeedStartFromInternal (#20996)

* Really Adding detection for transient generation of invalid json in ChangeFeedStartFromInternal

* Fixing StackOverflow error due to unintentional recursion

* Addressing test flakiness
  • Loading branch information
FabianMeiswinkel committed Apr 28, 2021
1 parent 8520929 commit 67c297e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class PartitionMetadataCacheITest
newStaleCachedItemRefreshPeriodInMsOverride = Some(10 * 1000),
newCachedItemTtlInMsOverride = Some(50))

Thread.sleep(500)
Thread.sleep(2000)
//scalastyle:on magic.number

PartitionMetadataCache.purge(containerConfig, feedRange) shouldEqual false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,17 @@ public void populatePropertyBag() {
}

@Override
public String toString()
{
String json = this.toJson();
public String toString() {
return this.toJson();
}

@Override
public String toJson() {
String json = super.toJson();

if (json.indexOf("\"Type\":") != json.lastIndexOf("\"Type\":")) {
// TODO @fabianm Remove as soon as root caused - https://github.com/Azure/azure-sdk-for-java/issues/20635
// "StartFrom":{"Type":"NOW","Type":"NOW"}
throw new IllegalStateException("There shouldn't be any duplicate json properties!");
}

Expand Down

0 comments on commit 67c297e

Please sign in to comment.