fix(multiplayer): complete live results atomically

This commit is contained in:
Josh Creek
2026-09-03 13:29:31 +01:00
parent 8c28374eb4
commit 2e9da3032c
6 changed files with 112 additions and 8 deletions
+11
View File
@@ -36,6 +36,17 @@ func TestResultStoreBindsWorkloadAndMakesIdenticalDuplicateInert(t *testing.T) {
}
}
func TestResultStoreRejectsMissingAuthoritativeTime(t *testing.T) {
binding := testBinding()
store, err := NewResultStore(binding)
if err != nil {
t.Fatal(err)
}
if _, _, err := store.Submit("result-1", testResult(), binding, time.Time{}); !errors.Is(err, ErrResultInvalid) {
t.Fatalf("zero-time result error = %v", err)
}
}
func TestConflictingResultIsInertAndIntegritySuppressesRating(t *testing.T) {
now := time.Unix(1000, 0)
binding := testBinding()