From 39248bc83757e5ea8f5277cfdd8be6acd8b689ba Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 5 Jan 2023 06:37:36 +0530 Subject: [PATCH] fixed tests --- .../EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml | 8 ++++---- .../EndToEndTraceWriterBaselineTests.ReadManyAsync.xml | 4 ++-- .../Tracing/CustomListener.cs | 7 ++++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index d89823fd70..fb0e1a6281 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -1569,9 +1569,9 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.status_code304db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.status_code304db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2167,10 +2167,10 @@ } ] }]]> - Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.status_code304db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.status_code304db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index d1a0cef2af..cf939021c7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -542,8 +542,8 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.status_code201db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.ReadManyItemsStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central US + Operation.ReadManyItemsStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_code200db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.status_code201db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.status_code201db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.status_code201db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.status_code201db.cosmosdb.sub_status_code0db.cosmosdb.request_chargedb.cosmosdb.activity_iddb.cosmosdb.regions_contactedSouth Central US diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs index ad726f11f6..3e0ed1494f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs @@ -270,8 +270,13 @@ public List GetRecordedAttributes() { List generatedActivityTagsForBaselineXmls = new(); List collectedActivities = new List(CustomListener.CollectedActivities); + + collectedActivities.OrderBy(activity => activity.Id); - collectedActivities.ForEach(activity => generatedActivityTagsForBaselineXmls.Add(this.GenerateTagForBaselineTest(activity))); + foreach (Activity activity in collectedActivities) + { + generatedActivityTagsForBaselineXmls.Add(this.GenerateTagForBaselineTest(activity)); + } List outputList = new List(); if(generatedActivityTagsForBaselineXmls != null && generatedActivityTagsForBaselineXmls.Count > 0)