From b92214d50cc0a57fded1c2b3b4d4aa69347e68f1 Mon Sep 17 00:00:00 2001 From: vikas singh Date: Thu, 27 Jul 2023 12:49:42 +0530 Subject: [PATCH] Added entropy to database names created across bulk tests for @azure/cosmso (#26625) ### Packages impacted by this PR @azure/cosmso ### Issues associated with this PR ### Describe the problem that is addressed by this PR Few tests in `sdk/cosmosdb/cosmos/test/public/functional/item/bulk.item.spec.ts` share name of database created. This could result in race condition, where one test deletes on database while the other tests expects it to be there. ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary) --- .../cosmos/test/public/functional/item/bulk.item.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdk/cosmosdb/cosmos/test/public/functional/item/bulk.item.spec.ts b/sdk/cosmosdb/cosmos/test/public/functional/item/bulk.item.spec.ts index 6e10b7ccdb39..bb56e7a1e447 100644 --- a/sdk/cosmosdb/cosmos/test/public/functional/item/bulk.item.spec.ts +++ b/sdk/cosmosdb/cosmos/test/public/functional/item/bulk.item.spec.ts @@ -783,6 +783,7 @@ describe("test bulk operations", async function () { readItemId = addEntropy("item1"); const dataset: BulkTestDataSet = { ...defaultBulkTestDataSet, + dbName: addEntropy("respects order"), documentToCreate: [{ id: readItemId, key: "A", class: "2010" }], operations: [ { @@ -812,6 +813,7 @@ describe("test bulk operations", async function () { it("424 errors for operations after an error", async function () { const dataset: BulkTestDataSet = { ...defaultBulkTestDataSet, + dbName: addEntropy("424 errors"), documentToCreate: [], operations: [ { @@ -835,6 +837,7 @@ describe("test bulk operations", async function () { it("Continues after errors with continueOnError true", async function () { const dataset: BulkTestDataSet = { ...defaultBulkTestDataSet, + dbName: addEntropy("continueOnError"), documentToCreate: [], bulkOperationOptions: { continueOnError: true, @@ -862,6 +865,7 @@ describe("test bulk operations", async function () { it("autogenerates IDs for Create operations", async function () { const dataset: BulkTestDataSet = { ...defaultBulkTestDataSet, + dbName: addEntropy("autogenerateIDs"), operations: [ { description: "Operation should fail with invalid ttl.", @@ -882,6 +886,7 @@ describe("test bulk operations", async function () { const item3Id = addEntropy("item2"); const dataset: BulkTestDataSet = { ...defaultBulkTestDataSet, + dbName: addEntropy("handle special partition keys"), documentToCreate: [ { id: item1Id, key: null, class: "2010" }, { id: item2Id, key: 0 },