Quarantine missing platform log batches
This commit is contained in:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user