Skip to content

Commit

Permalink
Improve failure reporting in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed Dec 4, 2024
1 parent 3906dc5 commit e3da715
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 162 deletions.
10 changes: 6 additions & 4 deletions src/BuiltInTools/dotnet-watch/HotReloadDotNetWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ void FileChangedCallback(string path, ChangeKind kind)
{
ImmutableInterlocked.Update(ref changedFilesAccumulator, changedFiles => changedFiles.Add(changedFile));
}
else
{
Context.Reporter.Verbose($"Change ignored: {kind} '{path}'.");
}
}

fileChangedCallback = FileChangedCallback;
Expand Down Expand Up @@ -455,6 +451,11 @@ async Task<ImmutableList<ChangedFile>> CaptureChangedFilesSnapshot(ImmutableDict
{
// start next iteration unless shutdown is requested
}
catch (Exception) when ((waitForFileChangeBeforeRestarting = false) == true)
{
// unreachable
throw new InvalidOperationException();
}
finally
{
// stop watching file changes:
Expand Down Expand Up @@ -599,6 +600,7 @@ private async ValueTask WaitForFileChangeBeforeRestarting(FileWatcher fileWatche
return new ChangedFile(new FileItem { FilePath = path, ContainingProjectPaths = [] }, kind);
}

Context.Reporter.Verbose($"Change ignored: {kind} '{path}'.");
return null;
}

Expand Down
Loading

0 comments on commit e3da715

Please sign in to comment.