From 5ddbd5e881e210638fc31b4d4a7a0cb1d3f91702 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Fri, 20 Oct 2023 14:19:12 +0700 Subject: [PATCH] add test verifying that awaiting migration can't start after the migration service is shutdown --- backend/Testing/LexCore/Services/RepoMigrationTests.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/Testing/LexCore/Services/RepoMigrationTests.cs b/backend/Testing/LexCore/Services/RepoMigrationTests.cs index 6e10cc568..86f27f2b7 100644 --- a/backend/Testing/LexCore/Services/RepoMigrationTests.cs +++ b/backend/Testing/LexCore/Services/RepoMigrationTests.cs @@ -259,4 +259,12 @@ public async Task ShutdownServiceShouldCancelAnyMigrationFinishedTasks() await migrationP1Task.ShouldThrowAsync(); await migrationP2Task.ShouldThrowAsync(); } + + [Fact] + public async Task CantWaitMigrationWhenServiceIsShuttingDown() + { + await StartMigrationService(); + await _repoMigrationService.StopAsync(Timeout()); + await _repoMigrationService.WaitMigrationFinishedAsync("p1", Timeout()).ShouldThrowAsync(); + } }