Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 26, 2025

Please check the following before creating a Pull Request

  • If this is a new feature or piece of functionality, have you started a discussion and gotten agreement on it?
  • If it fixes a bug or problem, is there an issue to track it? If not, create one first and link it please so there's clear visibility.
  • Did you write tests to ensure you code works properly?

Fixes #2193

Documentation referenced a [assembly: MaxParallelTests(Environment.ProcessorCount)] attribute that doesn't exist in the codebase.

Changes

  • docs/docs/guides/best-practices.md: Replaced non-existent attribute reference with correct APIs
  • docs/docs/advanced/performance-best-practices.md: Added complete working example using actual APIs

Correct APIs for Controlling Parallelism

// Assembly-level attribute with IParallelLimit implementation
[assembly: ParallelLimiter<ProcessorCountLimit>]

public class ProcessorCountLimit : IParallelLimit
{
    public int Limit => Environment.ProcessorCount;
}
# CLI flag
dotnet test -- --maximum-parallel-tests 8

# Environment variable
export TUNIT_MAX_PARALLEL_TESTS=8
Original prompt

This section details on the original issue you should resolve

<issue_title>The "MaxParallelTests" attribute can be found only in documetation and does not exist in actual code</issue_title>
<issue_description>Hello,
In the documentation i found mentioning of MaxParallelTests attribute, but after searching through the codebase, I couldn't find an implementation for it. It seems specific to the documentation.

References:
Best Practices Guide
Performance Guide

Maybe the workaround could be something like

using TUnit.Core.Interfaces;

[assembly: ParallelLimiter<DefaultMaxParallelLimitLimit>]

public class DefaultMaxParallelLimitLimit : IParallelLimit
{
    public int Limit { get; } = Environment.ProcessorCount;
}
```</issue_description>

<agent_instructions>Remove the incorrect documentation and use actual APIs or cli flags that exist</agent_instructions>

## Comments on the Issue (you are @copilot in this section)

<comments>
<comment_new><author>@thomhurst</author><body>
Thanks - yeah that documentation is wrong.

For enforcing a global limit, you could either use the assembly level parallel limit as suggested, or use `--maximum-parallel-tests` if using the CLI</body></comment_new>
</comments>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove incorrect MaxParallelTests documentation docs: Remove non-existent MaxParallelTests attribute from documentation Nov 26, 2025
Copilot AI requested a review from thomhurst November 26, 2025 16:19
Copilot finished work on behalf of thomhurst November 26, 2025 16:19
@thomhurst thomhurst marked this pull request as ready for review November 26, 2025 16:38
@thomhurst thomhurst merged commit a9ca8cb into main Nov 26, 2025
5 checks passed
@thomhurst thomhurst deleted the copilot/remove-maxparalleltests-docs branch November 26, 2025 16:38
This was referenced Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants