mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-09-12 13:47:16 -04:00
All three Windows CI legs failed on master while the other six passed, and not on an assertion: every test in FileLiberator.Tests' PDF path suite failed in TestInitialize with an AggregateException wrapping FileNotFoundException, naming a path none of those tests had anything to do with. The watcher had raised Created for a folder an earlier test's cleanup then deleted. AddPath asked whether the path existed, was told yes, asked what it was, and got an exception - Exists and GetAttributes can disagree over a long \\?\ path, and the answer to the first can stop being true before the second is asked anyway. That exception ended the background scanner, so nothing further reached the cache, and it was stored on the task, so the next Stop() rethrew it as an AggregateException at whoever had called Refresh(). In the app that caller is the Books directory refresh after every download. Three changes, smallest first: the attribute read is guarded and returns 'nothing to add' where the existence check used to say it, which also removes the race rather than narrowing it; the scanner survives an event it cannot apply; and Stop() waits on a scanner that has already failed without handing the failure to a caller that is about to replace it. Co-authored-by: rmcrackan <rmcrackan@gmail.com>
2 lines
95 B
C#
2 lines
95 B
C#
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(nameof(FileManager) + ".Tests")]
|