injecting network faults under synctest

147 views
Skip to first unread message

Jason E. Aten

unread,
Jun 14, 2025, 8:12:32 PMJun 14
to golang-nuts
Go 1.25rc1 includes the new exciting and no-longer-experimental 
testing/synctest package. 

To make use of synctest in your tests of network code, you'll need to mock,
or simulate the network. 

To help with this, I wrote gosimnet. https://github.com/glycerine/gosimnet

Gosimnet not only mocks (simulates) the network in a way that
enables synctest bubbles to block, but also allows you to isolate servers,
and to inject asymmetric and probabilistic network card faults into the mock.

A whole set of faults and be applied, and reversed,  with a single call.

I've fleshed out the API for fault modeling recently. You can see the API description here. 

https://github.com/glycerine/gosimnet?tab=readme-ov-file#network-modeling-api-summary

It is not set in stone yet, to allow for your feedback.

Enjoy.

Jason
Reply all
Reply to author
Forward
0 new messages