-
-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
[Before] hooks are not counted towards the total test time, but [After] hooks are
Expected Behavior
The total time for A should be either ~300ms or ~100ms
Actual Behavior
The total time for A is ~200ms
Steps to Reproduce
public class Example
{
[Test]
public async Task A()
{
await Task.Delay(100);
await Assert.That(true).IsEqualTo(true);
}
}
public static class ExampleHooks
{
[BeforeEvery(Test)]
public static async Task Setup(CancellationToken token)
{
await Task.Delay(100, token);
}
[AfterEvery(Test)]
public static async Task Finish(CancellationToken token)
{
await Task.Delay(100, token);
}
}TUnit Version
1.13.11
.NET Version
.NET 10.0
Operating System
Windows
IDE / Test Runner
Visual Studio
Error Output / Stack Trace
Additional Context
I'm not 100% sure whether including the hooks in the test time makes sense or not, since I could see the argument of "It's 'before' or 'after' the test and therefore not part of it". But it should at least be consistent, and it probably makes more sense to include them if they count towards the timeout period.
IDE-Specific Issue?
- I've confirmed this issue occurs when running via
dotnet testordotnet run, not just in my IDE
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working