Commit dfaceae
Fix TimeoutAttribute not being applied to non-test hooks
The TimeoutAttribute on [Before(Assembly)], [Before(Class)], [Before(TestSession)],
and [Before(TestDiscovery)] hooks was being ignored because ProcessHookRegistrationAsync
was not being called for these hooks. This commit:
- Adds async versions of hook delegate creation methods that call ProcessHookRegistrationAsync
- Updates InitializeAsync to await the async hook building methods
- Converts CollectBeforeAssemblyHooksAsync, CollectAfterAssemblyHooksAsync,
CollectBeforeClassHooksAsync, and CollectAfterClassHooksAsync to properly
process hook registration events
- Adds HookTimeoutTests to verify the fix works for class and assembly hooks
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>1 parent 98eab14 commit dfaceae
File tree
3 files changed
+342
-134
lines changed- TUnit.Engine.Tests
- TUnit.Engine/Services
- TUnit.TestProject
3 files changed
+342
-134
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments