Commit b4391ed80f

b4391ed80f932f30dc3c9c30f26f73fd3aa3b95b

parent: 4ac9bff752

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-09 00:28 UTC

Match the announced repo in the admin delete test

Parallel suites post .gitbayRepositoryChanged for other repos, so
taking the first notification failed under full-suite load. Wait for
sim/app, with a one-minute limit.

Layout: unified · split

gitbayTests/AdminRepoTests.swift +5 −2
@@ -75,7 +75,8 @@ struct AdminRepoTests {
75@MainActor 75@MainActor
76struct AdminRepoDeleteTests { 76struct AdminRepoDeleteTests {
77 77
78 @Test func aDeleteWhoseRetryFindsNothingIsDoneAndAnnounced() async throws { 78 @Test(.timeLimit(.minutes(1)))
79 func aDeleteWhoseRetryFindsNothingIsDoneAndAnnounced() async throws {
79 let (client, stub) = try makeClient() 80 let (client, stub) = try makeClient()
80 stub.enqueue(.init(status: 200, json: listJSON, match: "argv=list")) 81 stub.enqueue(.init(status: 200, json: listJSON, match: "argv=list"))
81 stub.enqueue(.init(status: 500, json: #"{"protocol_version":1,"error":"cleanup failed","exit_code":1}"#, match: "cmd")) 82 stub.enqueue(.init(status: 500, json: #"{"protocol_version":1,"error":"cleanup failed","exit_code":1}"#, match: "cmd"))
@@ -86,7 +87,9 @@ struct AdminRepoDeleteTests {
86 let repo = try #require(model.list.state.value?.first) 87 let repo = try #require(model.list.state.value?.first)
87 let announced = NotificationCenter.default.notifications(named: .gitbayRepositoryChanged) 88 let announced = NotificationCenter.default.notifications(named: .gitbayRepositoryChanged)
88 89
89 async let first = announced.first { _ in true } 90 // Suites run in parallel and post the same notification for other
91 // repos, so wait for this one.
92 async let first = announced.first { $0.object as? String == "sim/app" }
90 await model.perform(.delete, on: repo) 93 await model.perform(.delete, on: repo)
91 94
92 #expect(model.actionError == nil) 95 #expect(model.actionError == nil)