Test: il registro degli impieghi si aspetta dopo la richiesta
MaintenanceDetailsOnRequest falliva a volte (#24, sul runner e 2 volte su 4 in locale con tutta la suite): il server manda il registro anche da solo a inizio mese, già al giorno 0 prima che l'officina esista, e il test prendeva quello invece della risposta. Ora aspetta un registro diverso da quello già ricevuto: 6 esecuzioni complete su 6 verdi. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
83316d4c8d
commit
10a508e719
2 files changed
+5
-3
No files matched your search
@@ -244,10 +244,12 @@ public static class ServerTests
|
||||
Assert.Equal("service", register.Jobs[0].Intervention);
|
||||
await client.WaitUntil(() => w.Trains[train].Maintenance == TrainMaintenanceStatus.InWorkshop, "treno in officina nel riepilogo");
|
||||
|
||||
// il server manda il registro anche da solo a inizio mese (anche al giorno 0, prima dell'officina):
|
||||
// si aspetta quello che arriva dopo la richiesta, non uno già in mano (#24)
|
||||
var stale = w.Employment;
|
||||
await client.Connection.SendAsync(new RequestDetail { Kind = DetailKind.Employment, Target = 0 });
|
||||
var report = await client.WaitFor(() => w.Employment, "registro degli impieghi");
|
||||
var report = await client.WaitFor(() => ReferenceEquals(w.Employment, stale) ? null : w.Employment, "registro degli impieghi");
|
||||
var row = report.Rows.FirstOrDefault(r => r.Kind == 1 && r.Industry == depot);
|
||||
// test intermittente sul runner (#24): il messaggio riporta cosa è arrivato davvero
|
||||
Assert.True(row is not null, $"l'officina {depot} compare nel registro del giorno {report.Day}; righe: "
|
||||
+ string.Join(", ", report.Rows.Select(r => $"{r.Kind}:{r.Industry}")));
|
||||
Assert.Equal(16, row!.JobsStaff);
|
||||
|
||||
Reference in new issue
Block a user