Skip to content

Commit ceb12cb

Browse files
committed
Fix unfinished dependency regression scheduling race (#7564)
1 parent 38b7f77 commit ceb12cb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎tests/TUnit.TestProject/DependsOnTests2.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public async Task Test2()
2626
[Test]
2727
public async Task Test3()
2828
{
29-
await Assert.That(() => TestContext.Current!.Dependencies.GetTests(nameof(Test1))).ThrowsException().WithMessage("Cannot get unfinished tests - Did you mean to add a [DependsOn] attribute?");
29+
// This test is guaranteed to be unfinished while its body is running.
30+
await Assert.That(() => TestContext.Current!.Dependencies.GetTests(nameof(Test3))).ThrowsException().WithMessage("Cannot get unfinished tests - Did you mean to add a [DependsOn] attribute?");
3031
}
3132

3233
[After(Class)]

0 commit comments

Comments
 (0)