Skip to content

Commit fdca653

Browse files
Disable hanging tests (#988)
Disable hanging tests
1 parent fc7ec26 commit fdca653

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

test/coverlet.core.tests/Coverage/CoverageTests.DoesNotReturn.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void NoBranches_DoesNotReturnAttribute_InstrumentsCorrect()
4141
}
4242
}
4343

44-
[Fact]
44+
[Fact(Skip = "Hang due to System.Console.ReadKey()")]
4545
public void If_DoesNotReturnAttribute_InstrumentsCorrect()
4646
{
4747
string path = Path.GetTempFileName();
@@ -73,7 +73,7 @@ public void If_DoesNotReturnAttribute_InstrumentsCorrect()
7373
}
7474
}
7575

76-
[Fact]
76+
[Fact(Skip = "Hang due to System.Console.ReadKey()")]
7777
public void Switch_DoesNotReturnAttribute_InstrumentsCorrect()
7878
{
7979
string path = Path.GetTempFileName();
@@ -105,7 +105,7 @@ public void Switch_DoesNotReturnAttribute_InstrumentsCorrect()
105105
}
106106
}
107107

108-
[Fact]
108+
[Fact(Skip = "Hang due to System.Console.ReadKey()")]
109109
public void Subtle_DoesNotReturnAttribute_InstrumentsCorrect()
110110
{
111111
string path = Path.GetTempFileName();
@@ -137,7 +137,7 @@ public void Subtle_DoesNotReturnAttribute_InstrumentsCorrect()
137137
}
138138
}
139139

140-
[Fact]
140+
[Fact(Skip = "Hang due to System.Console.ReadKey()")]
141141
public void UnreachableBranch_DoesNotReturnAttribute_InstrumentsCorrect()
142142
{
143143
string path = Path.GetTempFileName();

test/coverlet.core.tests/Instrumentation/ModuleTrackerTemplateTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.IO;
34
using System.Threading;
45
using System.Threading.Tasks;
@@ -62,14 +63,21 @@ public void HitsOnMultipleThreadsCorrectlyCounted()
6263
{
6364
FunctionExecutor.Run(() =>
6465
{
66+
List<Thread> threads = new List<Thread>();
6567
using var ctx = new TrackerContext();
6668
ModuleTrackerTemplate.HitsArray = new[] { 0, 0, 0, 0 };
6769
for (int i = 0; i < ModuleTrackerTemplate.HitsArray.Length; ++i)
6870
{
6971
var t = new Thread(HitIndex);
72+
threads.Add(t);
7073
t.Start(i);
7174
}
7275

76+
foreach (Thread t in threads)
77+
{
78+
t.Join();
79+
}
80+
7381
ModuleTrackerTemplate.UnloadModule(null, null);
7482
var expectedHitsArray = new[] { 4, 3, 2, 1 };
7583
Assert.Equal(expectedHitsArray, ReadHitsFile());

0 commit comments

Comments
 (0)