Hero: zelftest en mapcontrole van de media draaien op de achtergrond, zodat de host niet later gaat luisteren
De hosted services starten voor de webserver; de zelftest van Magick (laden van de native bibliotheek en een testcodering) kostte op de Pi ongeveer 9 s voordat de host luisterde. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -286,7 +286,9 @@ public class MediaDirectoryCheckTests
|
||||
var status = new MediaStatus();
|
||||
var areas = new MediaAreaRegistry();
|
||||
|
||||
await Check(media.Store, status, areas, media.Directory, "hero").StartAsync(CancellationToken.None);
|
||||
var check = Check(media.Store, status, areas, media.Directory, "hero");
|
||||
await check.StartAsync(CancellationToken.None);
|
||||
await check.Completion;
|
||||
|
||||
status.DirectoryWritable.Should().BeTrue();
|
||||
areas.Contains("hero").Should().BeTrue();
|
||||
@@ -298,7 +300,9 @@ public class MediaDirectoryCheckTests
|
||||
var status = new MediaStatus();
|
||||
status.SetDirectory(true);
|
||||
|
||||
await Check(Substitute.For<IMediaStore>(), status, new MediaAreaRegistry(), null).StartAsync(CancellationToken.None);
|
||||
var check = Check(Substitute.For<IMediaStore>(), status, new MediaAreaRegistry(), null);
|
||||
await check.StartAsync(CancellationToken.None);
|
||||
await check.Completion;
|
||||
|
||||
status.DirectoryWritable.Should().BeFalse();
|
||||
}
|
||||
@@ -310,7 +314,9 @@ public class MediaDirectoryCheckTests
|
||||
store.ProbeAsync(default).ReturnsForAnyArgs(false);
|
||||
var status = new MediaStatus();
|
||||
|
||||
await Check(store, status, new MediaAreaRegistry(), "/somewhere").StartAsync(CancellationToken.None);
|
||||
var check = Check(store, status, new MediaAreaRegistry(), "/somewhere");
|
||||
await check.StartAsync(CancellationToken.None);
|
||||
await check.Completion;
|
||||
|
||||
status.DirectoryWritable.Should().BeFalse();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user