Stabilize abort coordinator test
PR and Push Build/Test / build-and-test (push) Successful in 9m20s

This commit is contained in:
2026-06-11 15:58:50 +02:00
parent 86e3efa3f6
commit bd786426bf
@@ -843,6 +843,7 @@ public sealed class RecordingCoordinatorTests
}; };
var audioSource = new ControlledAudioSource(); var audioSource = new ControlledAudioSource();
var summaryPipeline = new CapturingMeetingSummaryPipeline(); var summaryPipeline = new CapturingMeetingSummaryPipeline();
var metadataProvider = new BlockingMeetingMetadataProvider(new MeetingMetadata("", [], ""));
var coordinator = new MeetingRecordingCoordinator( var coordinator = new MeetingRecordingCoordinator(
audioSource, audioSource,
new TestSpeechRecognitionPipelineFactory(new EchoStreamingTranscriptionProvider()), new TestSpeechRecognitionPipelineFactory(new EchoStreamingTranscriptionProvider()),
@@ -853,37 +854,44 @@ public sealed class RecordingCoordinatorTests
new InMemoryRecordedAudioStore(), new InMemoryRecordedAudioStore(),
summaryPipeline, summaryPipeline,
Options.Create(options), Options.Create(options),
NullLogger<MeetingRecordingCoordinator>.Instance); NullLogger<MeetingRecordingCoordinator>.Instance,
meetingMetadataProvider: metadataProvider);
var started = await coordinator.StartAsync(CancellationToken.None); try
await audioSource.WriteAsync(new AudioChunk([1, 0], 16000, 1), CancellationToken.None); {
await WaitUntilAsync(() => var started = await coordinator.StartAsync(CancellationToken.None);
FileContainsText(started.AssistantContextPath!, "state: transcribing")); await audioSource.WriteAsync(new AudioChunk([1, 0], 16000, 1), CancellationToken.None);
var attachmentPath = Path.Combine( await WaitUntilAsync(() => File.Exists(started.AssistantContextPath!));
Path.GetDirectoryName(started.AssistantContextPath!)!, var attachmentPath = Path.Combine(
"Attachments", Path.GetDirectoryName(started.AssistantContextPath!)!,
"20260527-093135-123-000010-cropped.png"); "Attachments",
Directory.CreateDirectory(Path.GetDirectoryName(attachmentPath)!); "20260527-093135-123-000010-cropped.png");
await File.WriteAllTextAsync(attachmentPath, "image"); Directory.CreateDirectory(Path.GetDirectoryName(attachmentPath)!);
await AppendTextWithRetryAsync( await File.WriteAllTextAsync(attachmentPath, "image");
started.AssistantContextPath!, await AppendTextWithRetryAsync(
Environment.NewLine + "![Cropped screenshot](Attachments/20260527-093135-123-000010-cropped.png)" + Environment.NewLine); started.AssistantContextPath!,
Directory.CreateDirectory(Path.GetDirectoryName(started.SummaryPath!)!); Environment.NewLine + "![Cropped screenshot](Attachments/20260527-093135-123-000010-cropped.png)" + Environment.NewLine);
await File.WriteAllTextAsync(started.SummaryPath!, "draft summary"); Directory.CreateDirectory(Path.GetDirectoryName(started.SummaryPath!)!);
await File.WriteAllTextAsync(started.SummaryPath!, "draft summary");
var aborted = await coordinator.AbortAsync(CancellationToken.None); var aborted = await coordinator.AbortAsync(CancellationToken.None);
Assert.False(aborted.IsRecording); Assert.False(aborted.IsRecording);
Assert.Null(aborted.MeetingNotePath); Assert.Null(aborted.MeetingNotePath);
Assert.False(File.Exists(started.MeetingNotePath)); Assert.False(File.Exists(started.MeetingNotePath));
Assert.False(File.Exists(started.TranscriptPath)); Assert.False(File.Exists(started.TranscriptPath));
Assert.False(File.Exists(started.AssistantContextPath)); Assert.False(File.Exists(started.AssistantContextPath));
Assert.False(File.Exists(started.SummaryPath)); Assert.False(File.Exists(started.SummaryPath));
Assert.False(File.Exists(attachmentPath)); Assert.False(File.Exists(attachmentPath));
Assert.Null(summaryPipeline.Artifacts); Assert.Null(summaryPipeline.Artifacts);
await Task.Delay(250); await Task.Delay(250);
Assert.False(File.Exists(started.AssistantContextPath)); Assert.False(File.Exists(started.AssistantContextPath));
}
finally
{
metadataProvider.Release();
}
} }
[Fact] [Fact]