From 597df5ee1e8d5c2bb099bd2c3d65e015d200cd15 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Thu, 20 Mar 2025 15:50:19 -0700 Subject: [PATCH 01/11] added operationCancelledException catch --- Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs index 819064c958..c76250b6df 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs @@ -53,6 +53,10 @@ public override async Task SendAsync( throw; } + catch (OperationCanceledException ex) + { + throw new CosmosOperationCanceledException(ex, request.Trace); + } finally { request.OnBeforeSendRequestActions -= retryPolicyInstance.OnBeforeSendRequest; From 8b3d01fd373d5bc56f56f3383713d60e18148f34 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Wed, 28 May 2025 12:22:17 -0700 Subject: [PATCH 02/11] test adjustments --- Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs | 1 + .../ClientConfigurationDiagnosticTest.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs index af812b0abb..a090b33957 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs @@ -55,6 +55,7 @@ public override async Task SendAsync( } catch (OperationCanceledException ex) { + Console.WriteLine("Operation was canceled: " + ex.Message); throw new CosmosOperationCanceledException(ex, request.Trace); } finally diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs index 742d6df4ab..836c542236 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs @@ -154,6 +154,7 @@ public async Task VerifyDiagnosticsOrderTest() } catch (CosmosOperationCanceledException oce) { + Console.WriteLine(oce.Diagnostics.ToString()); IReadOnlyList children = ((CosmosTraceDiagnostics)oce.Diagnostics).Value.Children; ITrace exceptionChild = children[^1]; Assert.AreEqual("CosmosOperationCanceledException", exceptionChild.Name); From 82befc4e3343fd290dda27885a75f75fabebee3b Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Wed, 28 May 2025 12:35:01 -0700 Subject: [PATCH 03/11] Update ClientConfigurationDiagnosticTest.cs --- .../ClientConfigurationDiagnosticTest.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs index 836c542236..9a7f096b84 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs @@ -154,9 +154,12 @@ public async Task VerifyDiagnosticsOrderTest() } catch (CosmosOperationCanceledException oce) { - Console.WriteLine(oce.Diagnostics.ToString()); IReadOnlyList children = ((CosmosTraceDiagnostics)oce.Diagnostics).Value.Children; ITrace exceptionChild = children[^1]; + foreach (ITrace child in children) + { + Console.WriteLine($"Child Trace: {child.Name}"); + } Assert.AreEqual("CosmosOperationCanceledException", exceptionChild.Name); Assert.IsNotNull(exceptionChild.Data["Operation Cancelled Exception"]); } From bdb323bd3464f88051e3a4ce8d78f6e5ce1b8a4d Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Wed, 28 May 2025 13:00:54 -0700 Subject: [PATCH 04/11] Update AbstractRetryHandler.cs --- .../src/Handler/AbstractRetryHandler.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs index a090b33957..1ef51d547a 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs @@ -53,11 +53,11 @@ public override async Task SendAsync( throw; } - catch (OperationCanceledException ex) - { - Console.WriteLine("Operation was canceled: " + ex.Message); - throw new CosmosOperationCanceledException(ex, request.Trace); - } + //catch (OperationCanceledException ex) + //{ + // Console.WriteLine("Operation was canceled: " + ex.Message); + // throw new CosmosOperationCanceledException(ex, request.Trace); + //} finally { request.OnBeforeSendRequestActions -= retryPolicyInstance.OnBeforeSendRequest; From 9bec9d6e043112a7b8373bf50bde7cb2c2dae961 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Wed, 28 May 2025 14:13:44 -0700 Subject: [PATCH 05/11] Update ClientConfigurationDiagnosticTest.cs --- .../ClientConfigurationDiagnosticTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs index 9a7f096b84..3677ebcb5c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs @@ -160,6 +160,7 @@ public async Task VerifyDiagnosticsOrderTest() { Console.WriteLine($"Child Trace: {child.Name}"); } + Assert.Fail("idk bruh"); Assert.AreEqual("CosmosOperationCanceledException", exceptionChild.Name); Assert.IsNotNull(exceptionChild.Data["Operation Cancelled Exception"]); } From 6e95ad2d7c29dace19ad6a5c5d50357d9f72cbb5 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Wed, 28 May 2025 14:50:03 -0700 Subject: [PATCH 06/11] testing --- .../src/Handler/AbstractRetryHandler.cs | 10 +++++----- .../ClientConfigurationDiagnosticTest.cs | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs index 1ef51d547a..a090b33957 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs @@ -53,11 +53,11 @@ public override async Task SendAsync( throw; } - //catch (OperationCanceledException ex) - //{ - // Console.WriteLine("Operation was canceled: " + ex.Message); - // throw new CosmosOperationCanceledException(ex, request.Trace); - //} + catch (OperationCanceledException ex) + { + Console.WriteLine("Operation was canceled: " + ex.Message); + throw new CosmosOperationCanceledException(ex, request.Trace); + } finally { request.OnBeforeSendRequestActions -= retryPolicyInstance.OnBeforeSendRequest; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs index 3677ebcb5c..ce92d1c479 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs @@ -161,6 +161,7 @@ public async Task VerifyDiagnosticsOrderTest() Console.WriteLine($"Child Trace: {child.Name}"); } Assert.Fail("idk bruh"); + Console.WriteLine($"{exceptionChild.Data}"); Assert.AreEqual("CosmosOperationCanceledException", exceptionChild.Name); Assert.IsNotNull(exceptionChild.Data["Operation Cancelled Exception"]); } From 10043aa3fae825d809448bdaae10b9c89be41ff1 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Mon, 2 Jun 2025 15:03:05 -0700 Subject: [PATCH 07/11] info --- .../ClientConfigurationDiagnosticTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs index ce92d1c479..35e0658bff 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs @@ -160,7 +160,7 @@ public async Task VerifyDiagnosticsOrderTest() { Console.WriteLine($"Child Trace: {child.Name}"); } - Assert.Fail("idk bruh"); + Assert.Fail("Test Fail info"); Console.WriteLine($"{exceptionChild.Data}"); Assert.AreEqual("CosmosOperationCanceledException", exceptionChild.Name); Assert.IsNotNull(exceptionChild.Data["Operation Cancelled Exception"]); From f1fe63cf663eaa46dda80a3254c17929ad290ffc Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Mon, 2 Jun 2025 15:07:24 -0700 Subject: [PATCH 08/11] test print --- .../ClientConfigurationDiagnosticTest.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs index 35e0658bff..8ca5a84e13 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs @@ -161,7 +161,12 @@ public async Task VerifyDiagnosticsOrderTest() Console.WriteLine($"Child Trace: {child.Name}"); } Assert.Fail("Test Fail info"); - Console.WriteLine($"{exceptionChild.Data}"); + Console.WriteLine($"Look at diag"); + + for (int i = 0; i < oce.Diagnostics.ToString().Length; i+=100) + { + Console.WriteLine(oce.Diagnostics.ToString().Substring(i, Math.Min(100, oce.Diagnostics.ToString().Length - i))); + } Assert.AreEqual("CosmosOperationCanceledException", exceptionChild.Name); Assert.IsNotNull(exceptionChild.Data["Operation Cancelled Exception"]); } From a7899cb8c72444511f1add9e662fd08a833701ee Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Mon, 2 Jun 2025 15:09:37 -0700 Subject: [PATCH 09/11] test print fix --- Microsoft.Azure.Cosmos.sln | 16 ++++++++++++++-- .../ClientConfigurationDiagnosticTest.cs | 3 ++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Microsoft.Azure.Cosmos.sln b/Microsoft.Azure.Cosmos.sln index cec2d9a5f4..fc2a5d3ddd 100644 --- a/Microsoft.Azure.Cosmos.sln +++ b/Microsoft.Azure.Cosmos.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29123.88 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36121.58 d17.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Cosmos", "Microsoft.Azure.Cosmos\src\Microsoft.Azure.Cosmos.csproj", "{36F6F6A8-CEC8-4261-9948-903495BC3C25}" EndProject @@ -181,6 +181,18 @@ Global {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|Any CPU.Build.0 = Release|Any CPU {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|x64.ActiveCfg = Release|Any CPU {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|x64.Build.0 = Release|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Cover|Any CPU.ActiveCfg = Debug|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Cover|Any CPU.Build.0 = Debug|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Cover|x64.ActiveCfg = Debug|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Cover|x64.Build.0 = Debug|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Debug|x64.ActiveCfg = Debug|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Debug|x64.Build.0 = Debug|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Release|Any CPU.Build.0 = Release|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Release|x64.ActiveCfg = Release|Any CPU + {D744906A-1091-403F-B0B6-794DE045169A}.Release|x64.Build.0 = Release|Any CPU {CE4D6DA8-148D-4A98-943B-D8C2D532E1DC}.Cover|Any CPU.ActiveCfg = Debug|Any CPU {CE4D6DA8-148D-4A98-943B-D8C2D532E1DC}.Cover|Any CPU.Build.0 = Debug|Any CPU {CE4D6DA8-148D-4A98-943B-D8C2D532E1DC}.Cover|x64.ActiveCfg = Debug|Any CPU diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs index 8ca5a84e13..93936fad0b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs @@ -160,13 +160,14 @@ public async Task VerifyDiagnosticsOrderTest() { Console.WriteLine($"Child Trace: {child.Name}"); } - Assert.Fail("Test Fail info"); + Console.WriteLine($"Look at diag"); for (int i = 0; i < oce.Diagnostics.ToString().Length; i+=100) { Console.WriteLine(oce.Diagnostics.ToString().Substring(i, Math.Min(100, oce.Diagnostics.ToString().Length - i))); } + Assert.Fail("Test Fail info"); Assert.AreEqual("CosmosOperationCanceledException", exceptionChild.Name); Assert.IsNotNull(exceptionChild.Data["Operation Cancelled Exception"]); } From ed5d226abc96d6fb644aefdb356dc2082c5ff423 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Mon, 2 Jun 2025 15:10:47 -0700 Subject: [PATCH 10/11] fix sln --- Microsoft.Azure.Cosmos.sln | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Microsoft.Azure.Cosmos.sln b/Microsoft.Azure.Cosmos.sln index fc2a5d3ddd..cec2d9a5f4 100644 --- a/Microsoft.Azure.Cosmos.sln +++ b/Microsoft.Azure.Cosmos.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.14.36121.58 d17.14 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29123.88 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Cosmos", "Microsoft.Azure.Cosmos\src\Microsoft.Azure.Cosmos.csproj", "{36F6F6A8-CEC8-4261-9948-903495BC3C25}" EndProject @@ -181,18 +181,6 @@ Global {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|Any CPU.Build.0 = Release|Any CPU {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|x64.ActiveCfg = Release|Any CPU {021DDC27-02EF-42C4-9A9E-AA600833C2EE}.Release|x64.Build.0 = Release|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Cover|Any CPU.ActiveCfg = Debug|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Cover|Any CPU.Build.0 = Debug|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Cover|x64.ActiveCfg = Debug|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Cover|x64.Build.0 = Debug|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Debug|x64.ActiveCfg = Debug|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Debug|x64.Build.0 = Debug|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Release|Any CPU.Build.0 = Release|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Release|x64.ActiveCfg = Release|Any CPU - {D744906A-1091-403F-B0B6-794DE045169A}.Release|x64.Build.0 = Release|Any CPU {CE4D6DA8-148D-4A98-943B-D8C2D532E1DC}.Cover|Any CPU.ActiveCfg = Debug|Any CPU {CE4D6DA8-148D-4A98-943B-D8C2D532E1DC}.Cover|Any CPU.Build.0 = Debug|Any CPU {CE4D6DA8-148D-4A98-943B-D8C2D532E1DC}.Cover|x64.ActiveCfg = Debug|Any CPU From 44c7d8157c9ecf24f8eaaf3b5d76548bdf16574f Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Mon, 2 Jun 2025 15:39:46 -0700 Subject: [PATCH 11/11] Updated test Updated test to take out runtime differences in diagnostics to where OperationExceptionException occurs --- .../src/Handler/AbstractRetryHandler.cs | 1 - .../ClientConfigurationDiagnosticTest.cs | 19 +++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs index a090b33957..af812b0abb 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/AbstractRetryHandler.cs @@ -55,7 +55,6 @@ public override async Task SendAsync( } catch (OperationCanceledException ex) { - Console.WriteLine("Operation was canceled: " + ex.Message); throw new CosmosOperationCanceledException(ex, request.Trace); } finally diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs index 93936fad0b..ef7efd9f16 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs @@ -154,22 +154,9 @@ public async Task VerifyDiagnosticsOrderTest() } catch (CosmosOperationCanceledException oce) { - IReadOnlyList children = ((CosmosTraceDiagnostics)oce.Diagnostics).Value.Children; - ITrace exceptionChild = children[^1]; - foreach (ITrace child in children) - { - Console.WriteLine($"Child Trace: {child.Name}"); - } - - Console.WriteLine($"Look at diag"); - - for (int i = 0; i < oce.Diagnostics.ToString().Length; i+=100) - { - Console.WriteLine(oce.Diagnostics.ToString().Substring(i, Math.Min(100, oce.Diagnostics.ToString().Length - i))); - } - Assert.Fail("Test Fail info"); - Assert.AreEqual("CosmosOperationCanceledException", exceptionChild.Name); - Assert.IsNotNull(exceptionChild.Data["Operation Cancelled Exception"]); + //check that the exception child exists in the trace diagnostics + Assert.IsTrue(oce.Diagnostics.ToString().Contains("CosmosOperationCanceledException")); + Assert.IsTrue(oce.Diagnostics.ToString().Contains("Operation Cancelled Exception")); } } }