From 537624a7d21be5bd5b18fd2d91f1513ea45dc493 Mon Sep 17 00:00:00 2001 From: philipthomas Date: Mon, 3 Jun 2024 13:23:37 -0400 Subject: [PATCH 01/18] longrunning cfp avad test for ttl --- .../FullFidelity/ChangeFeedMetadata.cs | 2 +- .../ChangeFeed/BaseChangeFeedClientHelper.cs | 2 +- ...orBuilderWithAllVersionsAndDeletesTests.cs | 124 ++++++++++++++++++ 3 files changed, 126 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs index c5bd4642fa..6a0359d7db 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs @@ -68,6 +68,6 @@ public ChangeFeedMetadata( /// Used to distinquish explicit deletes (e.g. via DeleteItem) from deletes caused by TTL expiration (a collection may define time-to-live policy for documents). /// [JsonProperty(PropertyName = "timeToLiveExpired", NullValueHandling= NullValueHandling.Ignore)] - public bool IsTimeToLiveExpired { get; } + public bool IsTimeToLiveExpired { get; set; } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs index 12cd3768ee..19940ad9aa 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs @@ -9,7 +9,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests.ChangeFeed public class BaseChangeFeedClientHelper : BaseCosmosClientHelper { - public static int ChangeFeedSetupTime = 1000; + public static int ChangeFeedSetupTime = 5000; public static int ChangeFeedCleanupTime = 5000; public Container LeaseContainer = null; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs index 7217993fd5..162a01ecb4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs @@ -6,11 +6,13 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests.ChangeFeed { using System; using System.Collections.Generic; + using System.Diagnostics; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.ChangeFeed.Utils; using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json; using Newtonsoft.Json.Linq; [TestClass] @@ -29,6 +31,127 @@ public async Task Cleanup() await base.TestCleanup(); } + [TestMethod] + [TestCategory("LongRunning")] + [Owner("philipthomas-MSFT")] + [Description("Scenario: When a document is created with ttl set, there should be 1 create and 1 delete that will appear for that " + + "document when using ChangeFeedProcessor with AllVersionsAndDeletes set as the ChangeFeedMode.")] + public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsAsync() + { + ContainerInternal monitoredContainer = await this.CreateMonitoredContainer(ChangeFeedMode.AllVersionsAndDeletes); + Exception exception = default; + int ttlInSeconds = 5; + Stopwatch stopwatch = new(); + + ChangeFeedProcessor processor = monitoredContainer + .GetChangeFeedProcessorBuilderWithAllVersionsAndDeletes(processorName: "processor", onChangesDelegate: (ChangeFeedProcessorContext context, IReadOnlyCollection> docs, CancellationToken token) => + { + // NOTE(philipthomas-MSFT): Please allow these Debug lines because TTL on items will purge at random times so I am using this to test when ran locally using emulator. + + Debug.WriteLine($"@ {DateTime.Now}, {nameof(stopwatch)} -> CFP AVAD took '{stopwatch.ElapsedMilliseconds}' to read document CRUD in feed."); + Debug.WriteLine($"@ {DateTime.Now}, {nameof(docs)} -> {JsonConvert.SerializeObject(docs)}"); + + foreach (ChangeFeedItem change in docs) + { + if (change.Metadata.OperationType == ChangeFeedOperationType.Create) + { + // current + Assert.AreEqual(expected: "1", actual: change.Current.id.ToString()); + Assert.AreEqual(expected: "1", actual: change.Current.pk.ToString()); + Assert.AreEqual(expected: "Testing TTL on CFP.", actual: change.Current.description.ToString()); + Assert.AreEqual(expected: ttlInSeconds, actual: change.Current.ttl.ToObject()); + + // metadata + Assert.IsTrue(DateTime.TryParse(s: change.Metadata.ConflictResolutionTimestamp.ToString(), out _), message: "Invalid csrt must be a datetime value."); + Assert.IsTrue(long.TryParse(change.Metadata.Lsn.ToString(), out _), message: "Invalid lsn must be a long value."); + Assert.AreEqual(expected: false, actual: change.Metadata.IsTimeToLiveExpired); + + // previous + Assert.IsNull(change.Previous); + } + else if (change.Metadata.OperationType == ChangeFeedOperationType.Delete) + { + // stop after reading delete since it is the last document in feed. + stopwatch.Stop(); + + // current + Assert.IsNull(change.Current.id); + + // metadata + Assert.IsTrue(DateTime.TryParse(s: change.Metadata.ConflictResolutionTimestamp.ToString(), out _), message: "Invalid csrt must be a datetime value."); + Assert.IsTrue(long.TryParse(change.Metadata.Lsn.ToString(), out _), message: "Invalid lsn must be a long value."); + Assert.AreEqual(expected: true, actual: change.Metadata.IsTimeToLiveExpired); + + // previous + Assert.AreEqual(expected: "1", actual: change.Current.id.ToString()); + Assert.AreEqual(expected: "1", actual: change.Current.pk.ToString()); + Assert.AreEqual(expected: "Testing TTL on CFP.", actual: change.Current.description.ToString()); + Assert.AreEqual(expected: ttlInSeconds, actual: change.Current.ttl.ToObject()); + } + else + { + Assert.Fail("Invalid operation."); + } + } + + return Task.CompletedTask; + }) + .WithInstanceName(Guid.NewGuid().ToString()) + .WithLeaseContainer(this.LeaseContainer) + .WithErrorNotification((leaseToken, error) => + { + exception = error.InnerException; + + return Task.CompletedTask; + }) + .Build(); + + stopwatch.Start(); + + // NOTE(philipthomas-MSFT): Please allow these Debug lines because TTL on items will purge at random times so I am using this to test when ran locally using emulator. + + Debug.WriteLine($"@ {DateTime.Now}, CFProcessor starting..."); + + await processor.StartAsync(); + await Task.Delay(GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.ChangeFeedSetupTime); + await monitoredContainer.CreateItemAsync(new { id = "1", pk = "1", description = "Testing TTL on CFP.", ttl = ttlInSeconds }, partitionKey: new PartitionKey("1")); + + // NOTE(philipthomas-MSFT): Please allow these Debug lines because TTL on items will purge at random times so I am using this to test when ran locally using emulator. + + Debug.WriteLine($"@ {DateTime.Now}, Document created."); + + await GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.CheckIfAllDocumentsAreProcessed( + stopwatch: stopwatch, + processor: processor); + + if (exception != default) + { + Assert.Fail(exception.ToString()); + } + } + + /// + /// I am writing this differently because I am finding that TTL on CFP always purge at random times. Sometimes it is almost instant, sometimes + /// it was north of 5 minutes. So I can't just give it a cap to check for 'x' number of seconds or minutes. + /// + /// + /// + /// + private static async Task CheckIfAllDocumentsAreProcessed( + Stopwatch stopwatch, + ChangeFeedProcessor processor) + { + do + { + if (!stopwatch.IsRunning) + { + await processor.StopAsync(); + + break; + } + } while (stopwatch.IsRunning); + } + [TestMethod] [Owner("philipthomas-MSFT")] [Description("Scenario: When a document is created, then updated, and finally deleted, there should be 3 changes that will appear for that " + @@ -467,6 +590,7 @@ private async Task CreateMonitoredContainer(ChangeFeedMode ch if (changeFeedMode == ChangeFeedMode.AllVersionsAndDeletes) { properties.ChangeFeedPolicy.FullFidelityRetention = TimeSpan.FromMinutes(5); + properties.DefaultTimeToLive = -1; } ContainerResponse response = await this.database.CreateContainerAsync(properties, From c6981faf10debfbbe8c5ff0f112af68d21664e2d Mon Sep 17 00:00:00 2001 From: philipthomas Date: Mon, 3 Jun 2024 13:34:10 -0400 Subject: [PATCH 02/18] add more to comment --- ...ChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs index 162a01ecb4..f6ec9762f7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs @@ -132,7 +132,8 @@ await GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.CheckIfAllDocu /// /// I am writing this differently because I am finding that TTL on CFP always purge at random times. Sometimes it is almost instant, sometimes - /// it was north of 5 minutes. So I can't just give it a cap to check for 'x' number of seconds or minutes. + /// it was north of 5 minutes. So I can't just give it a cap to check for 'x' number of seconds or minutes. I am giving the test category as + /// LongRunning so it will not be ran during the pipeline until I create a pipeline specifcally for LongRunning. /// /// /// From d8da605c1ca2f5f5ae3f10424edca7a330a27e72 Mon Sep 17 00:00:00 2001 From: philipthomas Date: Mon, 3 Jun 2024 14:02:21 -0400 Subject: [PATCH 03/18] internal set --- .../src/Resource/FullFidelity/ChangeFeedMetadata.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs index 6a0359d7db..64c02f19e3 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs @@ -68,6 +68,6 @@ public ChangeFeedMetadata( /// Used to distinquish explicit deletes (e.g. via DeleteItem) from deletes caused by TTL expiration (a collection may define time-to-live policy for documents). /// [JsonProperty(PropertyName = "timeToLiveExpired", NullValueHandling= NullValueHandling.Ignore)] - public bool IsTimeToLiveExpired { get; set; } + public bool IsTimeToLiveExpired { get; internal set; } } } From cce1f30a9743fc97ac872eb47c801590ff72a9f3 Mon Sep 17 00:00:00 2001 From: philipthomas Date: Mon, 3 Jun 2024 15:18:25 -0400 Subject: [PATCH 04/18] other tests fail with higher ms --- .../ChangeFeed/BaseChangeFeedClientHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs index 19940ad9aa..12cd3768ee 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs @@ -9,7 +9,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests.ChangeFeed public class BaseChangeFeedClientHelper : BaseCosmosClientHelper { - public static int ChangeFeedSetupTime = 5000; + public static int ChangeFeedSetupTime = 1000; public static int ChangeFeedCleanupTime = 5000; public Container LeaseContainer = null; From a5efaed0ad865c412bfd4a889ec70d6dad2a4e6b Mon Sep 17 00:00:00 2001 From: philipthomas Date: Mon, 3 Jun 2024 15:29:54 -0400 Subject: [PATCH 05/18] run updatecontracts --- .../Contracts/DotNetPreviewSDKAPI.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index b43ef3d0e7..e9a4831e1b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -89,7 +89,7 @@ "Attributes": [ "JsonPropertyAttribute" ], - "MethodInfo": "Boolean IsTimeToLiveExpired;CanRead:True;CanWrite:False;Boolean get_IsTimeToLiveExpired();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "Boolean IsTimeToLiveExpired;CanRead:True;CanWrite:True;Boolean get_IsTimeToLiveExpired();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, "Int64 get_Lsn()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", From 3e9820e86e702a6cb3f078f70e572342331d464e Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:31:34 -0400 Subject: [PATCH 06/18] Update Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs Co-authored-by: Matias Quaranta --- ...tChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs index f6ec9762f7..c9b20682ef 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs @@ -63,7 +63,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA // metadata Assert.IsTrue(DateTime.TryParse(s: change.Metadata.ConflictResolutionTimestamp.ToString(), out _), message: "Invalid csrt must be a datetime value."); - Assert.IsTrue(long.TryParse(change.Metadata.Lsn.ToString(), out _), message: "Invalid lsn must be a long value."); + Assert.IsTrue(change.Metadata.Lsn > 0, message: "Invalid lsn must be a long value."); Assert.AreEqual(expected: false, actual: change.Metadata.IsTimeToLiveExpired); // previous From 4b52819b49c7901086d0900274845a99ab4e600d Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:31:43 -0400 Subject: [PATCH 07/18] Update Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs Co-authored-by: Matias Quaranta --- ...tChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs index c9b20682ef..46b17c034e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs @@ -64,7 +64,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA // metadata Assert.IsTrue(DateTime.TryParse(s: change.Metadata.ConflictResolutionTimestamp.ToString(), out _), message: "Invalid csrt must be a datetime value."); Assert.IsTrue(change.Metadata.Lsn > 0, message: "Invalid lsn must be a long value."); - Assert.AreEqual(expected: false, actual: change.Metadata.IsTimeToLiveExpired); + Assert.IsFalse(change.Metadata.IsTimeToLiveExpired); // previous Assert.IsNull(change.Previous); From cc171fe4db489dda0ceb869d88a4dda94899a092 Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:31:53 -0400 Subject: [PATCH 08/18] Update Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs Co-authored-by: Matias Quaranta --- ...tChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs index 46b17c034e..29b742e1e3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs @@ -79,7 +79,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA // metadata Assert.IsTrue(DateTime.TryParse(s: change.Metadata.ConflictResolutionTimestamp.ToString(), out _), message: "Invalid csrt must be a datetime value."); - Assert.IsTrue(long.TryParse(change.Metadata.Lsn.ToString(), out _), message: "Invalid lsn must be a long value."); + Assert.IsTrue(change.Metadata.Lsn. > 0, message: "Invalid lsn must be a long value."); Assert.AreEqual(expected: true, actual: change.Metadata.IsTimeToLiveExpired); // previous From 22633f623f2049c493bdff05d105ebb9666dae16 Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:32:03 -0400 Subject: [PATCH 09/18] Update Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs Co-authored-by: Matias Quaranta --- ...tChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs index 29b742e1e3..d94847ec9b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs @@ -80,7 +80,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA // metadata Assert.IsTrue(DateTime.TryParse(s: change.Metadata.ConflictResolutionTimestamp.ToString(), out _), message: "Invalid csrt must be a datetime value."); Assert.IsTrue(change.Metadata.Lsn. > 0, message: "Invalid lsn must be a long value."); - Assert.AreEqual(expected: true, actual: change.Metadata.IsTimeToLiveExpired); + Assert.IsTrue(change.Metadata.IsTimeToLiveExpired); // previous Assert.AreEqual(expected: "1", actual: change.Current.id.ToString()); From 696176a182a9c461c448b09742a224b02bd39b93 Mon Sep 17 00:00:00 2001 From: philipthomas Date: Tue, 4 Jun 2024 15:42:43 -0400 Subject: [PATCH 10/18] using Logger.LogLine --- ...ssorBuilderWithAllVersionsAndDeletesTests.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs index d94847ec9b..b17b1ade4e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs @@ -11,6 +11,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests.ChangeFeed using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.ChangeFeed.Utils; + using Microsoft.Azure.Cosmos.Services.Management.Tests; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -46,10 +47,10 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA ChangeFeedProcessor processor = monitoredContainer .GetChangeFeedProcessorBuilderWithAllVersionsAndDeletes(processorName: "processor", onChangesDelegate: (ChangeFeedProcessorContext context, IReadOnlyCollection> docs, CancellationToken token) => { - // NOTE(philipthomas-MSFT): Please allow these Debug lines because TTL on items will purge at random times so I am using this to test when ran locally using emulator. + // NOTE(philipthomas-MSFT): Please allow these Logger.LogLine because TTL on items will purge at random times so I am using this to test when ran locally using emulator. - Debug.WriteLine($"@ {DateTime.Now}, {nameof(stopwatch)} -> CFP AVAD took '{stopwatch.ElapsedMilliseconds}' to read document CRUD in feed."); - Debug.WriteLine($"@ {DateTime.Now}, {nameof(docs)} -> {JsonConvert.SerializeObject(docs)}"); + Logger.LogLine($"@ {DateTime.Now}, {nameof(stopwatch)} -> CFP AVAD took '{stopwatch.ElapsedMilliseconds}' to read document CRUD in feed."); + Logger.LogLine($"@ {DateTime.Now}, {nameof(docs)} -> {JsonConvert.SerializeObject(docs)}"); foreach (ChangeFeedItem change in docs) { @@ -79,7 +80,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA // metadata Assert.IsTrue(DateTime.TryParse(s: change.Metadata.ConflictResolutionTimestamp.ToString(), out _), message: "Invalid csrt must be a datetime value."); - Assert.IsTrue(change.Metadata.Lsn. > 0, message: "Invalid lsn must be a long value."); + Assert.IsTrue(change.Metadata.Lsn > 0, message: "Invalid lsn must be a long value."); Assert.IsTrue(change.Metadata.IsTimeToLiveExpired); // previous @@ -108,17 +109,17 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA stopwatch.Start(); - // NOTE(philipthomas-MSFT): Please allow these Debug lines because TTL on items will purge at random times so I am using this to test when ran locally using emulator. + // NOTE(philipthomas-MSFT): Please allow these Logger.LogLine because TTL on items will purge at random times so I am using this to test when ran locally using emulator. - Debug.WriteLine($"@ {DateTime.Now}, CFProcessor starting..."); + Logger.LogLine($"@ {DateTime.Now}, CFProcessor starting..."); await processor.StartAsync(); await Task.Delay(GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.ChangeFeedSetupTime); await monitoredContainer.CreateItemAsync(new { id = "1", pk = "1", description = "Testing TTL on CFP.", ttl = ttlInSeconds }, partitionKey: new PartitionKey("1")); - // NOTE(philipthomas-MSFT): Please allow these Debug lines because TTL on items will purge at random times so I am using this to test when ran locally using emulator. + // NOTE(philipthomas-MSFT): Please allow these Logger.LogLine because TTL on items will purge at random times so I am using this to test when ran locally using emulator. - Debug.WriteLine($"@ {DateTime.Now}, Document created."); + Logger.LogLine($"@ {DateTime.Now}, Document created."); await GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.CheckIfAllDocumentsAreProcessed( stopwatch: stopwatch, From 441bef7943cb54badd7c7dd1e90a5caeaad697b1 Mon Sep 17 00:00:00 2001 From: philipthomas Date: Thu, 6 Jun 2024 13:48:21 -0400 Subject: [PATCH 11/18] change back over to ManualResetEvent. fixed assert to look at Previous. keeping stopwatch just for logging. timeout at 5 minutes. --- ...orBuilderWithAllVersionsAndDeletesTests.cs | 44 +++++-------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs index b17b1ade4e..d7943d63c4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs @@ -33,6 +33,7 @@ public async Task Cleanup() } [TestMethod] + [Timeout(300000)] [TestCategory("LongRunning")] [Owner("philipthomas-MSFT")] [Description("Scenario: When a document is created with ttl set, there should be 1 create and 1 delete that will appear for that " + @@ -43,6 +44,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA Exception exception = default; int ttlInSeconds = 5; Stopwatch stopwatch = new(); + ManualResetEvent allDocsProcessed = new ManualResetEvent(false); ChangeFeedProcessor processor = monitoredContainer .GetChangeFeedProcessorBuilderWithAllVersionsAndDeletes(processorName: "processor", onChangesDelegate: (ChangeFeedProcessorContext context, IReadOnlyCollection> docs, CancellationToken token) => @@ -72,9 +74,6 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA } else if (change.Metadata.OperationType == ChangeFeedOperationType.Delete) { - // stop after reading delete since it is the last document in feed. - stopwatch.Stop(); - // current Assert.IsNull(change.Current.id); @@ -84,10 +83,14 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA Assert.IsTrue(change.Metadata.IsTimeToLiveExpired); // previous - Assert.AreEqual(expected: "1", actual: change.Current.id.ToString()); - Assert.AreEqual(expected: "1", actual: change.Current.pk.ToString()); - Assert.AreEqual(expected: "Testing TTL on CFP.", actual: change.Current.description.ToString()); - Assert.AreEqual(expected: ttlInSeconds, actual: change.Current.ttl.ToObject()); + Assert.AreEqual(expected: "1", actual: change.Previous.id.ToString()); + Assert.AreEqual(expected: "1", actual: change.Previous.pk.ToString()); + Assert.AreEqual(expected: "Testing TTL on CFP.", actual: change.Previous.description.ToString()); + Assert.AreEqual(expected: ttlInSeconds, actual: change.Previous.ttl.ToObject()); + + // stop after reading delete since it is the last document in feed. + stopwatch.Stop(); + allDocsProcessed.Set(); } else { @@ -121,9 +124,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA Logger.LogLine($"@ {DateTime.Now}, Document created."); - await GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.CheckIfAllDocumentsAreProcessed( - stopwatch: stopwatch, - processor: processor); + allDocsProcessed.WaitOne(); if (exception != default) { @@ -131,29 +132,6 @@ await GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.CheckIfAllDocu } } - /// - /// I am writing this differently because I am finding that TTL on CFP always purge at random times. Sometimes it is almost instant, sometimes - /// it was north of 5 minutes. So I can't just give it a cap to check for 'x' number of seconds or minutes. I am giving the test category as - /// LongRunning so it will not be ran during the pipeline until I create a pipeline specifcally for LongRunning. - /// - /// - /// - /// - private static async Task CheckIfAllDocumentsAreProcessed( - Stopwatch stopwatch, - ChangeFeedProcessor processor) - { - do - { - if (!stopwatch.IsRunning) - { - await processor.StopAsync(); - - break; - } - } while (stopwatch.IsRunning); - } - [TestMethod] [Owner("philipthomas-MSFT")] [Description("Scenario: When a document is created, then updated, and finally deleted, there should be 3 changes that will appear for that " + From b06cb0a7f2556b5418a3d7ec7b247258fe8802b8 Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:10:48 -0400 Subject: [PATCH 12/18] Update GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs Co-authored-by: Matias Quaranta --- ...ChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs index d7943d63c4..d9c881375f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs @@ -124,7 +124,8 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA Logger.LogLine($"@ {DateTime.Now}, Document created."); - allDocsProcessed.WaitOne(); + bool receivedDelete = allDocsProcessed.WaitOne(60000); + Assert.IsTrue(receivedDelete, "Timed out waiting for docs to process"); if (exception != default) { From 4ea8aeaec58279a4de6c4dc46c384deeced9444b Mon Sep 17 00:00:00 2001 From: philipthomas Date: Wed, 12 Jun 2024 10:39:43 -0400 Subject: [PATCH 13/18] try/finally --- ...orBuilderWithAllVersionsAndDeletesTests.cs | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs index d9c881375f..5594538f09 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs @@ -117,19 +117,27 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA Logger.LogLine($"@ {DateTime.Now}, CFProcessor starting..."); await processor.StartAsync(); - await Task.Delay(GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.ChangeFeedSetupTime); - await monitoredContainer.CreateItemAsync(new { id = "1", pk = "1", description = "Testing TTL on CFP.", ttl = ttlInSeconds }, partitionKey: new PartitionKey("1")); - // NOTE(philipthomas-MSFT): Please allow these Logger.LogLine because TTL on items will purge at random times so I am using this to test when ran locally using emulator. + try + { + await Task.Delay(GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.ChangeFeedSetupTime); + await monitoredContainer.CreateItemAsync(new { id = "1", pk = "1", description = "Testing TTL on CFP.", ttl = ttlInSeconds }, partitionKey: new PartitionKey("1")); - Logger.LogLine($"@ {DateTime.Now}, Document created."); + // NOTE(philipthomas-MSFT): Please allow these Logger.LogLine because TTL on items will purge at random times so I am using this to test when ran locally using emulator. - bool receivedDelete = allDocsProcessed.WaitOne(60000); - Assert.IsTrue(receivedDelete, "Timed out waiting for docs to process"); + Logger.LogLine($"@ {DateTime.Now}, Document created."); - if (exception != default) + bool receivedDelete = allDocsProcessed.WaitOne(300000); + Assert.IsTrue(receivedDelete, "Timed out waiting for docs to process"); + + if (exception != default) + { + Assert.Fail(exception.ToString()); + } + } + finally { - Assert.Fail(exception.ToString()); + await processor.StopAsync(); } } From 32be9facfe763ea3ceb78b739b666a14a3955896 Mon Sep 17 00:00:00 2001 From: Philip Thomas Date: Fri, 14 Jun 2024 14:45:05 -0400 Subject: [PATCH 14/18] removing ctor. making all set internal to address serialization issue. later PRs to test STJ de/serialization. --- .../FullFidelity/ChangeFeedMetadata.cs | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs index 64c02f19e3..38bf63c79b 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs @@ -19,50 +19,31 @@ namespace Microsoft.Azure.Cosmos #endif class ChangeFeedMetadata { - /// - /// New instance of meta data for created. - /// - /// - /// - /// - /// - public ChangeFeedMetadata( - DateTime conflictResolutionTimestamp, - long lsn, - ChangeFeedOperationType operationType, - long previousLsn) - { - this.ConflictResolutionTimestamp = conflictResolutionTimestamp; - this.Lsn = lsn; - this.OperationType = operationType; - this.PreviousLsn = previousLsn; - } - /// /// The conflict resolution timestamp. /// [JsonProperty(PropertyName = "crts", NullValueHandling = NullValueHandling.Ignore)] [JsonConverter(typeof(UnixDateTimeConverter))] - public DateTime ConflictResolutionTimestamp { get; } + public DateTime ConflictResolutionTimestamp { get; internal set; } /// /// The current logical sequence number. /// [JsonProperty(PropertyName = "lsn", NullValueHandling = NullValueHandling.Ignore)] - public long Lsn { get; } + public long Lsn { get; internal set; } /// /// The change feed operation type. /// [JsonProperty(PropertyName = "operationType")] [JsonConverter(typeof(StringEnumConverter))] - public ChangeFeedOperationType OperationType { get; } + public ChangeFeedOperationType OperationType { get; internal set; } /// /// The previous logical sequence number. /// [JsonProperty(PropertyName = "previousImageLSN", NullValueHandling = NullValueHandling.Ignore)] - public long PreviousLsn { get; } + public long PreviousLsn { get; internal set; } /// /// Used to distinquish explicit deletes (e.g. via DeleteItem) from deletes caused by TTL expiration (a collection may define time-to-live policy for documents). From 1cf88de5fce15cd4a67e267de5dc537990ef33b3 Mon Sep 17 00:00:00 2001 From: philipthomas Date: Fri, 14 Jun 2024 15:13:43 -0400 Subject: [PATCH 15/18] fixing de/serialziation issue --- .../FullFidelity/ChangeFeedMetadata.cs | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs index 64c02f19e3..6a467bc573 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs @@ -19,50 +19,31 @@ namespace Microsoft.Azure.Cosmos #endif class ChangeFeedMetadata { - /// - /// New instance of meta data for created. - /// - /// - /// - /// - /// - public ChangeFeedMetadata( - DateTime conflictResolutionTimestamp, - long lsn, - ChangeFeedOperationType operationType, - long previousLsn) - { - this.ConflictResolutionTimestamp = conflictResolutionTimestamp; - this.Lsn = lsn; - this.OperationType = operationType; - this.PreviousLsn = previousLsn; - } - /// /// The conflict resolution timestamp. /// [JsonProperty(PropertyName = "crts", NullValueHandling = NullValueHandling.Ignore)] [JsonConverter(typeof(UnixDateTimeConverter))] - public DateTime ConflictResolutionTimestamp { get; } + public DateTime ConflictResolutionTimestamp { get; internal set; } /// /// The current logical sequence number. /// [JsonProperty(PropertyName = "lsn", NullValueHandling = NullValueHandling.Ignore)] - public long Lsn { get; } + public long Lsn { get; internal set; } /// /// The change feed operation type. /// [JsonProperty(PropertyName = "operationType")] [JsonConverter(typeof(StringEnumConverter))] - public ChangeFeedOperationType OperationType { get; } + public ChangeFeedOperationType OperationType { get; internal set; } /// /// The previous logical sequence number. /// [JsonProperty(PropertyName = "previousImageLSN", NullValueHandling = NullValueHandling.Ignore)] - public long PreviousLsn { get; } + public long PreviousLsn { get; internal set; } /// /// Used to distinquish explicit deletes (e.g. via DeleteItem) from deletes caused by TTL expiration (a collection may define time-to-live policy for documents). From ada194eda345e384ad5d10f4ea2761d7933c8216 Mon Sep 17 00:00:00 2001 From: Philip Thomas Date: Mon, 17 Jun 2024 09:45:26 -0400 Subject: [PATCH 16/18] Update GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs change timeout --- ...tChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs index 5594538f09..0479bbb353 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/GetChangeFeedProcessorBuilderWithAllVersionsAndDeletesTests.cs @@ -127,7 +127,7 @@ public async Task WhenADocumentIsCreatedWithTtlSetThenTheDocumentIsDeletedTestsA Logger.LogLine($"@ {DateTime.Now}, Document created."); - bool receivedDelete = allDocsProcessed.WaitOne(300000); + bool receivedDelete = allDocsProcessed.WaitOne(250000); Assert.IsTrue(receivedDelete, "Timed out waiting for docs to process"); if (exception != default) From 2a5a30acdd461f2affcdd6aa1e0e890039ebec33 Mon Sep 17 00:00:00 2001 From: Philip Thomas Date: Mon, 17 Jun 2024 10:47:15 -0400 Subject: [PATCH 17/18] Update ReEncryption.csproj 1.11.4 --- .../Usage/ReEncryption/ReEncryption.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/ReEncryption/ReEncryption.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/ReEncryption/ReEncryption.csproj index 2677c74426..bd49c1df40 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/ReEncryption/ReEncryption.csproj +++ b/Microsoft.Azure.Cosmos.Samples/Usage/ReEncryption/ReEncryption.csproj @@ -8,7 +8,7 @@ latest - + From 4d06310d03a3945add801ffe9403f9f0ff18dade Mon Sep 17 00:00:00 2001 From: philipthomas Date: Mon, 17 Jun 2024 15:58:14 -0400 Subject: [PATCH 18/18] internal set change to CanWrite:True; --- .../Contracts/DotNetPreviewSDKAPI.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index e9a4831e1b..4a4b7b08dc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -110,14 +110,14 @@ "Attributes": [ "JsonPropertyAttribute" ], - "MethodInfo": "Int64 Lsn;CanRead:True;CanWrite:False;Int64 get_Lsn();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "Int64 Lsn;CanRead:True;CanWrite:True;Int64 get_Lsn();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, "Int64 PreviousLsn[Newtonsoft.Json.JsonPropertyAttribute(NullValueHandling = 1, PropertyName = \"previousImageLSN\")]": { "Type": "Property", "Attributes": [ "JsonPropertyAttribute" ], - "MethodInfo": "Int64 PreviousLsn;CanRead:True;CanWrite:False;Int64 get_PreviousLsn();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "Int64 PreviousLsn;CanRead:True;CanWrite:True;Int64 get_PreviousLsn();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, "Microsoft.Azure.Cosmos.ChangeFeedOperationType get_OperationType()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", @@ -132,7 +132,7 @@ "JsonConverterAttribute", "JsonPropertyAttribute" ], - "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedOperationType OperationType;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedOperationType get_OperationType();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedOperationType OperationType;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.ChangeFeedOperationType get_OperationType();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, "System.DateTime ConflictResolutionTimestamp[Newtonsoft.Json.JsonPropertyAttribute(NullValueHandling = 1, PropertyName = \"crts\")]-[Newtonsoft.Json.JsonConverterAttribute(typeof(Microsoft.Azure.Documents.UnixDateTimeConverter))]": { "Type": "Property", @@ -140,7 +140,7 @@ "JsonConverterAttribute", "JsonPropertyAttribute" ], - "MethodInfo": "System.DateTime ConflictResolutionTimestamp;CanRead:True;CanWrite:False;System.DateTime get_ConflictResolutionTimestamp();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "System.DateTime ConflictResolutionTimestamp;CanRead:True;CanWrite:True;System.DateTime get_ConflictResolutionTimestamp();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, "System.DateTime get_ConflictResolutionTimestamp()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", @@ -149,10 +149,10 @@ ], "MethodInfo": "System.DateTime get_ConflictResolutionTimestamp();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, - "Void .ctor(System.DateTime, Int64, Microsoft.Azure.Cosmos.ChangeFeedOperationType, Int64)": { + "Void .ctor()": { "Type": "Constructor", "Attributes": [], - "MethodInfo": "[Void .ctor(System.DateTime, Int64, Microsoft.Azure.Cosmos.ChangeFeedOperationType, Int64), Void .ctor(System.DateTime, Int64, Microsoft.Azure.Cosmos.ChangeFeedOperationType, Int64)]" + "MethodInfo": "[Void .ctor(), Void .ctor()]" } }, "NestedTypes": {}