Somehow I missed it when it was first announced, so only
recently did I discover the exciting testing/synctest experiment
available in go1.24.
If you are a fan of repeatable, deterministic tests
for tricky concurrent code... you should really check
out synctest.
My RPC package tests go 10x faster with the fake time
of synctest in place. Niiice.
Here is the post in case you missed it the first time
Caveats: one limitation of synctest is that it is kind of tricky to test network
code with it, because you aren't allowed to
talk to a "real" network. OS calls create
non-determinism. So you need a mocked or simulated
network, entirely in memory, using only channels,
for example.
I happened to need a network simulator myself for
testing my Raft implementation under partitions,
server power failures, reboots, etc... You know,
the general chaos that fault tolerant algorithms are
made for. Lacking a better alternative, I wrote one.
If you dismissed synctest before because you didn't have a network
simulator... happy birthday. Gosimnet implements net.Conn
and can crash, reboot, and partition servers.
It's probably got bugs, I'd consider it alpha quality,
but those can be fixed.
https://github.com/glycerine/gosimnet
Enjoy.
Jason