MCPcopy
hub / github.com/nats-io/nats.go / TestNoRaceObjectDoublePut

Function TestNoRaceObjectDoublePut

test/norace_test.go:86–104  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestNoRaceObjectDoublePut(t *testing.T) {
87 s := RunBasicJetStreamServer()
88 defer shutdownJSServerAndRemoveStorage(t, s)
89
90 nc, js := jsClient(t, s)
91 defer nc.Close()
92
93 obs, err := js.CreateObjectStore(&nats.ObjectStoreConfig{Bucket: "OBJS"})
94 expectOk(t, err)
95
96 _, err = obs.PutBytes("A", bytes.Repeat([]byte("A"), 1_000_000))
97 expectOk(t, err)
98
99 _, err = obs.PutBytes("A", bytes.Repeat([]byte("a"), 20_000_000))
100 expectOk(t, err)
101
102 _, err = obs.GetBytes("A")
103 expectOk(t, err)
104}
105
106func TestNoRaceJetStreamConsumerSlowConsumer(t *testing.T) {
107 // This test fails many times, need to look harder at the imbalance.

Callers

nothing calls this directly

Calls 8

RunBasicJetStreamServerFunction · 0.70
jsClientFunction · 0.70
expectOkFunction · 0.70
CreateObjectStoreMethod · 0.65
PutBytesMethod · 0.65
GetBytesMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected