Skip to content

Conversation

@thomhurst
Copy link
Owner

Fixes #4186

@github-actions
Copy link
Contributor

Summary

This PR fixes dynamic tests to inherit attributes from their test class and assembly.

Critical Issues

None found ✅

Suggestions

Performance: Attribute Collection Allocation

The new GetDynamicTestAttributes method creates a new List for every dynamic test during discovery (hot path). Consider:

  • Early-exit when TestClassType is null
  • Pre-allocate list capacity based on result.Attributes.Count + estimated class/assembly attributes
    However, this may be premature optimization - measure first if concerned.

Test Validation Timing

In DynamicTestInheritedAttributesTests line 78, the Task.Delay(100) seems fragile for detecting overlaps if tests run slowly. Consider more deterministic synchronization or longer buffer.

Verdict

✅ APPROVE - Implementation correctly fixes issue #4186 with proper dual-mode support and good test coverage.

@thomhurst thomhurst merged commit b1f8bb4 into main Dec 29, 2025
13 checks passed
@thomhurst thomhurst deleted the fix/dynamic-tests-inherit-class-attributes branch December 29, 2025 14:32
This was referenced Dec 29, 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

Development

Successfully merging this pull request may close these issues.

[Bug]: dynamic tests do not honor test class attributes

2 participants