Skip to content

Commit 071904f

Browse files
committed
Improve failure reporting in tests
1 parent 608fff9 commit 071904f

File tree

2 files changed

+130
-162
lines changed

2 files changed

+130
-162
lines changed

src/BuiltInTools/dotnet-watch/HotReloadDotNetWatcher.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,6 @@ void FileChangedCallback(string path, ChangeKind kind)
191191
{
192192
ImmutableInterlocked.Update(ref changedFilesAccumulator, changedFiles => changedFiles.Add(changedFile));
193193
}
194-
else
195-
{
196-
Context.Reporter.Verbose($"Change ignored: {kind} '{path}'.");
197-
}
198194
}
199195

200196
fileChangedCallback = FileChangedCallback;
@@ -455,6 +451,11 @@ async Task<ImmutableList<ChangedFile>> CaptureChangedFilesSnapshot(ImmutableDict
455451
{
456452
// start next iteration unless shutdown is requested
457453
}
454+
catch (Exception) when ((waitForFileChangeBeforeRestarting = false) == true)
455+
{
456+
// unreachable
457+
throw new InvalidOperationException();
458+
}
458459
finally
459460
{
460461
// stop watching file changes:
@@ -599,6 +600,7 @@ private async ValueTask WaitForFileChangeBeforeRestarting(FileWatcher fileWatche
599600
return new ChangedFile(new FileItem { FilePath = path, ContainingProjectPaths = [] }, kind);
600601
}
601602

603+
Context.Reporter.Verbose($"Change ignored: {kind} '{path}'.");
602604
return null;
603605
}
604606

0 commit comments

Comments
 (0)