nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
16k stars 1.41k forks source link

De-flake `TestFileStoreCorruptPSIMOnDisk` #6120

Closed neilalexander closed 1 week ago

neilalexander commented 1 week ago

Using crand was unpredictable because it might produce bytes that are a valid subject and therefore we wouldn't notice the problem in recoverFullState. Dropping in a UTF-8 rune error trips the detection always and is therefore more reliable.

Signed-off-by: Neil Twigg neil@nats.io