Skip to content

Commit ceab2cc

Browse files
authored
Fix non-awaited async call within a test (Azure#49431)
* fixing the non-awaited request inside an async function
1 parent b89d007 commit ceab2cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sdk/ai/Azure.AI.Projects/tests/AgentClientTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ public async Task TestListAgent()
162162
Assert.AreEqual(0, ids.Count);
163163
Assert.AreEqual(initialAgentCount + 2, count);
164164

165-
DeleteAndAssert(client, agent1);
165+
await DeleteAndAssert(client, agent1);
166166
ids.Add(agent1.Id);
167167
ids.Add(agent2.Id);
168168
count = await CountElementsAndRemoveIds(client, ids);
169169
Assert.AreEqual(1, ids.Count);
170170
Assert.False(ids.Contains(agent2.Id));
171171
Assert.AreEqual(initialAgentCount + 1, count);
172-
DeleteAndAssert(client, agent2);
172+
await DeleteAndAssert(client, agent2);
173173
}
174174

175175
[RecordedTest]
@@ -1377,7 +1377,7 @@ private AgentsClient GetClient()
13771377
}
13781378
}
13791379

1380-
private static async void DeleteAndAssert(AgentsClient client, Agent agent)
1380+
private static async Task DeleteAndAssert(AgentsClient client, Agent agent)
13811381
{
13821382
Response<bool> resp = await client.DeleteAgentAsync(agent.Id);
13831383
Assert.IsTrue(resp.Value);

0 commit comments

Comments
 (0)