mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 10:37:23 +01:00
23 lines
596 B
Go
23 lines
596 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/seaweedfs/seaweed-block/core/frontend/chunkstore/layout"
|
|
)
|
|
|
|
func TestLayoutQueueFullHasItsOwnRetryableCode(t *testing.T) {
|
|
err := fmt.Errorf("publish: %w", layout.ErrQueueFull)
|
|
if got := layoutCode(err); got != "queue_full" {
|
|
t.Fatalf("code=%q, want queue_full", got)
|
|
}
|
|
var out, diag bytes.Buffer
|
|
exit := chunkResult("snapshot-delete", nil, err, &out, &diag)
|
|
body := chunkErrorOut(t, out.String())
|
|
if exit != chunkExitFailed || body.Code != "queue_full" || !body.Retryable {
|
|
t.Fatalf("exit=%d body=%+v", exit, body)
|
|
}
|
|
}
|