This folder is where FrostDB's deterministic simulation test workload (see dst_test.go
) and runtime are stored.
Read the blog post on DST in FrostDB for a general background. In short, the deterministic simulation test is run as a workload against frostdb in TestDST
. Determinism is achieved by using a custom go runtime to compile the test and subsequently using wazero
with a special config (see the runtime
folder) seeded with the GORANDSEED
variable.
- github.com/polarsignals/go: download the repository and run
./make.bash
in thesrc
directory to build the custom go runtime.
Compile the test with the custom go runtime. First set the GOROOT
environment variable to the path of the custom go runtime and then compile (without running) the test binary to wasm.
export GOROOT=/path/to/polarsignals/go
GOOS=wasip1 GOARCH=wasm $GOROOT/bin/go test -tags=faketime -c -o dst/dst.wasm ./dst
See runtime/run.go
for the runtime configuration. The GORANDSEED
environment variable is used to seed the custom go runtime so must be provided for tests. Note the -test.v
flag is used to run the test in verbose mode. Any go testing flags can be added here at your convenience.
go build ./dst/runtime
GORANDSEED=<seed> ./runtime --module=./dst/dst.wasm -test.v