Skip to content

Commit 148ea17

Browse files
author
Simon Zhao (BEYONDSOFT CONSULTING INC)
committed
restore changes of WatchableApp.cs
1 parent 6dd5fa4 commit 148ea17

File tree

2 files changed

+6
-29
lines changed

2 files changed

+6
-29
lines changed

test/dotnet-watch.Tests/TestUtilities/WatchableApp.cs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ public async Task<string> AssertOutputLineStartsWith(string expectedPrefix, Pred
6565
{
6666
Logger.Log($"Test waiting for output: '{expectedPrefix}'", testPath, testLine);
6767

68-
var line = await TryGetOutputLineWithDelayAsync(
69-
expectedPrefix,
70-
failure ?? new Predicate<string>(line => line.Contains(WatchErrorOutputEmoji, StringComparison.Ordinal)));
68+
var line = await Process.GetOutputLineAsync(
69+
success: line => line.StartsWith(expectedPrefix, StringComparison.Ordinal),
70+
failure: failure ?? new Predicate<string>(line => line.Contains(WatchErrorOutputEmoji, StringComparison.Ordinal)));
7171

7272
if (line == null)
7373
{
@@ -171,28 +171,5 @@ public void SendKey(char c)
171171
Process.Process.StandardInput.Write(c);
172172
Process.Process.StandardInput.Flush();
173173
}
174-
175-
private async Task<string> TryGetOutputLineWithDelayAsync(string expectedPrefix, Predicate<string> failure, int maxAttempts = 2)
176-
{
177-
for (int attempt = 0; attempt < maxAttempts; attempt++)
178-
{
179-
if (attempt > 0)
180-
{
181-
Logger.Log($"Retrying to find output with prefix: '{expectedPrefix}' (attempt {attempt + 1}/{maxAttempts})");
182-
await Task.Delay(TimeSpan.FromSeconds(1));
183-
}
184-
185-
var line = await Process.GetOutputLineAsync(
186-
success: line => line.StartsWith(expectedPrefix, StringComparison.Ordinal),
187-
failure: failure);
188-
189-
if (line is not null)
190-
{
191-
return line;
192-
}
193-
}
194-
195-
return null;
196-
}
197174
}
198175
}

test/dotnet-watch.Tests/Watch/GlobbingAppTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public async Task ChangeCompiledFile(bool usePollingWatcher)
3434
await AssertCompiledAppDefinedTypes(expected: 2);
3535
}
3636

37-
[Fact]
37+
[Fact(Skip = "https://github.com/dotnet/sdk/issues/42921")]
3838
public async Task DeleteCompiledFile()
3939
{
4040
var testAsset = TestAssets.CopyTestAsset(AppName)
@@ -51,7 +51,7 @@ public async Task DeleteCompiledFile()
5151
await AssertCompiledAppDefinedTypes(expected: 1);
5252
}
5353

54-
[Fact]
54+
[Fact(Skip = "https://github.com/dotnet/sdk/issues/42921")]
5555
public async Task DeleteSourceFolder()
5656
{
5757
var testAsset = TestAssets.CopyTestAsset(AppName)
@@ -68,7 +68,7 @@ public async Task DeleteSourceFolder()
6868
await AssertCompiledAppDefinedTypes(expected: 1);
6969
}
7070

71-
[Fact]
71+
[Fact(Skip = "https://github.com/dotnet/sdk/issues/42921")]
7272
public async Task RenameCompiledFile()
7373
{
7474
var testAsset = TestAssets.CopyTestAsset(AppName)

0 commit comments

Comments
 (0)