Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/tests/backend/common/database/test_database_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@ async def get_team_agent(self, team_id, agent_name): return None
# Raise an exception to test cleanup
raise ValueError("Test exception")

# Even with exception, close should have been called
assert database.closed is True
# Even with exception, close should have been called
assert database.closed is True
Comment thread
Ashwal-Microsoft marked this conversation as resolved.
Outdated
Comment thread
Ashwal-Microsoft marked this conversation as resolved.
Outdated


class TestDatabaseBaseInheritance:
Expand Down
16 changes: 4 additions & 12 deletions src/tests/backend/v4/config/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,17 +336,13 @@ async def test_wait_for_approval_cancelled(self):

config.set_approval_pending(plan_id)

async def cancel_task():
await asyncio.sleep(0.05)
task.cancel()

task = asyncio.create_task(config.wait_for_approval(plan_id, timeout=1.0))
cancel_task_handle = asyncio.create_task(cancel_task())
await asyncio.sleep(0.05)
task.cancel()

with self.assertRaises(asyncio.CancelledError):
_ = await task
Comment thread
Ashwal-Microsoft marked this conversation as resolved.

await cancel_task_handle
self.assertTrue(task.cancelled())

async def test_wait_for_clarification_cancelled(self):
Expand All @@ -357,17 +353,13 @@ async def test_wait_for_clarification_cancelled(self):

config.set_clarification_pending(request_id)

async def cancel_task():
await asyncio.sleep(0.05)
task.cancel()

task = asyncio.create_task(config.wait_for_clarification(request_id, timeout=1.0))
cancel_task_handle = asyncio.create_task(cancel_task())
await asyncio.sleep(0.05)
task.cancel()

with self.assertRaises(asyncio.CancelledError):
_ = await task

await cancel_task_handle
self.assertTrue(task.cancelled())

def test_cleanup_approval(self):
Expand Down
Loading