Quarantine missing platform log batches

This commit is contained in:
npc0-hue
2026-08-31 00:18:10 +08:00
parent 34e240dc56
commit f63f0966ff
2 changed files with 19 additions and 0 deletions
+10
View File
@@ -640,6 +640,16 @@ func TestSessionLogBatchClientQuarantinesSequenceConflict(t *testing.T) {
}
}
func TestSessionLogBatchClientQuarantinesPlatformNotFound(t *testing.T) {
recorder := &recordingDurableLogClient{err: api.PlatformRequestError{Status: http.StatusNotFound, Code: "not_found"}}
client := sessionLogBatchClient{client: recorder, runEndpointID: "run-current", sessionToken: "token-current"}
_, err := client.IngestLogBatch(context.Background(), protocol.LogBatchIngestRequest{LogStreamID: "run.stale-endpoint.stale-server.session.stdout", FirstSeq: 1, LastSeq: 1, Entries: []protocol.LogEntry{{Seq: 1, Timestamp: workerTestTime(), Line: "line"}}})
var permanent spool.PermanentLogBatchError
if !errors.As(err, &permanent) || permanent.Reason != "platform_not_found" {
t.Fatalf("expected permanent platform_not_found rejection, got %#v", err)
}
}
func TestSessionLogBatchClientQuarantinesSessionMetadataMismatch(t *testing.T) {
recorder := &recordingDurableLogClient{err: api.PlatformRequestError{Status: http.StatusBadRequest, Code: "validation_failed", Details: []string{"log session metadata must match stream"}}}
client := sessionLogBatchClient{client: recorder, runEndpointID: "run-current", sessionToken: "token-current"}