test: require durability latency histograms in existing status

This commit is contained in:
pingqiu committed 2026-11-16 00:18:52 -08:00
1 parent 11f3afe6df
commit d71abccf6c
1 file changed
+28
@@ -0,0 +1,28 @@
package durable_test
import (
"context"
"encoding/json"
"testing"
)
func TestDurabilityLatencyStatusPresent(t *testing.T) {
b, _, _ := newTestBackend(t, logicalStorageFactories()[0], 16, 4096)
if _, err := b.Write(context.Background(), 0, make([]byte, 4096)); err != nil {
t.Fatal(err)
}
if err := b.Sync(context.Background()); err != nil {
t.Fatal(err)
}
data, err := json.Marshal(b.WriteProfile())
if err != nil {
t.Fatal(err)
}
var result map[string]json.RawMessage
if err := json.Unmarshal(data, &result); err != nil {
t.Fatal(err)
}
if _, ok := result["DurabilityLatency"]; !ok {
t.Fatalf("durability stage histograms missing from existing WriteProfile status: %s", data)
}
}