(If anyone more clever with hand illustration (or image gen AI...stable diffusion?) than me can contribute a better image of the Go Gopher playing with traffic, that would be great. While I still find it amusing, the current AI generated gopher is... not really satisfactory).
On Friday, May 9, 2025 at 12:16:59 PM UTC+1 Jason E. Aten wrote: > 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 > around like I did. https://go.dev/blog/synctest > And the docs, https://pkg.go.dev/testing/synctest > > 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 > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/311ee8c5-7df5-400c-b23d-eb0fddc74425n%40googlegroups.com.