Skip to content

CopilotChatClientTests: 15 tests fail due to synchronous Dispose() throwing NotSupportedException #74

@jkordick

Description

@jkordick

Description

All 15 tests in CopilotChatClientTests fail with the same root cause:

System.NotSupportedException: CopilotChatClient requires async disposal. Use 'await using' or call DisposeAsync() directly.

The error is thrown from CopilotChatClient.Dispose() (line 245 of Agents/Infrastructure/CopilotChatClient.cs). The synchronous Dispose() method throws NotSupportedException, causing every test that constructs a CopilotChatClient and disposes it synchronously to fail.

Failing Tests

All in CobolToQuarkusMigration.Tests/Agents/Infrastructure/CopilotChatClientTests.cs:

  • Constructor tests
  • Metadata tests
  • Service resolution tests
  • Disposal tests

Suggested Fix

Update the test fixtures to use await using or call DisposeAsync() instead of relying on synchronous Dispose(). Alternatively, implement a non-throwing synchronous Dispose() that delegates to DisposeAsync() if the tests need to support both patterns.

Context

Discovered during review of PR #67. These failures are pre-existing and unrelated to that PR's changes.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions