Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class CosmosItemThinClientTests

[TestInitialize]
public async Task TestInitAsync()
{
{
this.connectionString = Environment.GetEnvironmentVariable("COSMOSDB_THINCLIENT");
Environment.SetEnvironmentVariable(ConfigurationManager.ThinClientModeEnabled, "True");

Expand All @@ -52,8 +52,8 @@ public async Task TestInitAsync()
{
ConnectionMode = ConnectionMode.Gateway,
Serializer = this.cosmosSystemTextJsonSerializer,
});

});
string uniqueDbName = "TestDb_" + Guid.NewGuid().ToString();
this.database = await this.client.CreateDatabaseIfNotExistsAsync(uniqueDbName);
string uniqueContainerName = "TestContainer_" + Guid.NewGuid().ToString();
Expand Down Expand Up @@ -91,7 +91,8 @@ private IEnumerable<TestObject> GenerateItems(string partitionKey)
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task CreateItemsTest()
{
string pk = "pk_create";
Expand All @@ -105,7 +106,8 @@ public async Task CreateItemsTest()
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task ReadItemsTest()
{
string pk = "pk_read";
Expand All @@ -125,7 +127,8 @@ public async Task ReadItemsTest()
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task ReplaceItemsTest()
{
string pk = "pk_replace";
Expand All @@ -152,7 +155,8 @@ public async Task ReplaceItemsTest()
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task UpsertItemsTest()
{
string pk = "pk_upsert";
Expand All @@ -166,7 +170,8 @@ public async Task UpsertItemsTest()
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task DeleteItemsTest()
{
string pk = "pk_delete";
Expand All @@ -185,7 +190,8 @@ public async Task DeleteItemsTest()
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task CreateItemStreamTest()
{
string pk = "pk_create_stream";
Expand All @@ -204,7 +210,8 @@ public async Task CreateItemStreamTest()
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task ReadItemStreamTest()
{
string pk = "pk_read_stream";
Expand All @@ -225,7 +232,8 @@ public async Task ReadItemStreamTest()
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task ReplaceItemStreamTest()
{
string pk = "pk_replace_stream";
Expand Down Expand Up @@ -256,7 +264,8 @@ public async Task ReplaceItemStreamTest()
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task UpsertItemStreamTest()
{
string pk = "pk_upsert_stream";
Expand All @@ -275,7 +284,8 @@ public async Task UpsertItemStreamTest()
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task DeleteItemStreamTest()
{
string pk = "pk_delete_stream";
Expand All @@ -296,7 +306,8 @@ public async Task DeleteItemStreamTest()
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task QueryItemsTest()
{
string pk = "pk_query";
Expand All @@ -321,7 +332,8 @@ public async Task QueryItemsTest()
}

[TestMethod]
[TestCategory("ThinClient")]
[TestCategory("ThinClient")]
[Timeout(70000)]
public async Task QueryItemsStreamTest()
{
string pk = "pk_query_stream";
Expand Down
11 changes: 7 additions & 4 deletions templates/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ parameters:
jobs:
- job:
displayName: Microsoft.Azure.Cosmos.Tests
timeoutInMinutes: 120
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we keep the original timeout value and check if your test level timeouts (in the above file) covers it end to end ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still running into task cancellation as it times out after 60 minutes. So just experimenting in this branch to get the test jobs to pass.

pool:
name: 'OneES'

Expand Down Expand Up @@ -56,6 +57,7 @@ jobs:

- job:
displayName: Microsoft.Azure.Cosmos.Tests Flaky
timeoutInMinutes: 120
pool:
name: 'OneES'

Expand Down Expand Up @@ -91,6 +93,7 @@ jobs:

- job:
displayName: Microsoft.Azure.Cosmos.Tests Coverage
timeoutInMinutes: 120
condition: and(succeeded(), eq(${{ parameters.IncludeCoverage }}, true))
pool:
name: 'OneES'
Expand Down Expand Up @@ -176,7 +179,7 @@ jobs:

- job:
displayName: EmulatorTests ${{ parameters.BuildConfiguration }} - ${{ parameters.EmulatorPipeline1CategoryListName }}
timeoutInMinutes: 60
timeoutInMinutes: 120
condition: and(succeeded(), eq('${{ parameters.OS }}', 'Windows'))
pool:
name: 'OneES'
Expand Down Expand Up @@ -216,7 +219,7 @@ jobs:

- job:
displayName: EmulatorTests ${{ parameters.BuildConfiguration }} - ${{ parameters.EmulatorPipeline2CategoryListName }}
timeoutInMinutes: 60
timeoutInMinutes: 120
condition: and(succeeded(), eq('${{ parameters.OS }}', 'Windows'))
pool:
name: 'OneES'
Expand Down Expand Up @@ -377,7 +380,7 @@ jobs:

- job:
displayName: EmulatorTests ${{ parameters.BuildConfiguration }} - ${{ parameters.EmulatorPipeline3CategoryListName }}
timeoutInMinutes: 60
timeoutInMinutes: 120
condition: and(succeeded(), eq('${{ parameters.OS }}', 'Windows'))
pool:
name: 'OneES'
Expand Down Expand Up @@ -416,7 +419,7 @@ jobs:

- job:
displayName: EmulatorTests ${{ parameters.BuildConfiguration }} - ${{ parameters.EmulatorPipeline4CategoryListName }}
timeoutInMinutes: 60
timeoutInMinutes: 120
condition: and(succeeded(), eq('${{ parameters.OS }}', 'Windows'))
pool:
name: 'OneES'
Expand Down
Loading