Skip to content
Merged
Changes from all 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 @@ -10,9 +10,6 @@

namespace Microsoft.Agents.AI.Workflows.UnitTests;

Comment on lines 10 to 12
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

Removing the CollectionDefinition will break the test isolation for observability tests. Both WorkflowRunActivityStopTests and ObservabilityTests use the [Collection("ObservabilityTests")] attribute (line 18) to ensure they run serially, as they both use ActivityListener which is a global resource. Without the CollectionDefinition with DisableParallelization = true, xUnit will not find the collection definition and the tests may run in parallel, causing interference between tests. The ObservabilityTests.cs file explicitly documents this requirement in its class comments (lines 17-19): "Tests are run in a collection to avoid parallel execution since ActivityListener is global." The pattern used here matches the CosmosDBCollectionFixture pattern (dotnet/tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/CosmosDBCollectionFixture.cs:10) which also uses CollectionDefinition with DisableParallelization for tests that share global resources.

Suggested change
namespace Microsoft.Agents.AI.Workflows.UnitTests;
using Xunit;
namespace Microsoft.Agents.AI.Workflows.UnitTests;
[CollectionDefinition("ObservabilityTests", DisableParallelization = true)]
public sealed class ObservabilityTestsCollectionDefinition
{
}

Copilot uses AI. Check for mistakes.
[CollectionDefinition("ObservabilityTests", DisableParallelization = true)]
public class NoParallelizationObservabilityTests { }

/// <summary>
/// Regression test for https://github.com/microsoft/agent-framework/issues/4155
/// Verifies that the workflow_invoke Activity is properly stopped/disposed so it gets exported
Expand Down
Loading