// TestEtcd runs a 3 node etcd cluster, partitions the network between the
// nodes, and makes sure key-value puts and gets work.
func TestEtcd(t *testing.T) {
gosim.SetSimulationTimeout(2 * time.Minute)
// run machines:
gosim.NewMachine(gosim.MachineConfig{
Label: "etcd-1",
Addr: netip.MustParseAddr("10.0.0.1"),
MainFunc: func() {
runEtcdNode("etcd-1", "10.0.0.1")
},
})
gosim.NewMachine(gosim.MachineConfig{
Label: "etcd-2",
Addr: netip.MustParseAddr("10.0.0.2"),
MainFunc: func() {
time.Sleep(100 * time.Millisecond)
runEtcdNode("etcd-2", "10.0.0.2")
},
})
gosim.NewMachine(gosim.MachineConfig{
Label: "etcd-3",
Addr: netip.MustParseAddr("10.0.0.3"),
MainFunc: func() {
time.Sleep(200 * time.Millisecond)
runEtcdNode("etcd-3", "10.0.0.3")
},
})
// mess with the network in the background
go nemesis.Sequence(
nemesis.Sleep{
Duration: 10 * time.Second,
},
nemesis.PartitionMachines{
Addresses: []string{
"10.0.0.1",
"10.0.0.2",
"10.0.0.3",
},
Duration: 30 * time.Second,
},
).Run()--
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...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/CAP%3DJquaBu1O5rN6aR6fMs03q4O92cPAc9DfGQZ9fck9zB2sEkw%40mail.gmail.com.
~/go/src/github.com/jellevandenhooff/gosim/examples/etcd (main) $ gosim test -v
2025/08/27 12:28:46 ERROR missing function body pkg=internal/runtime/sys name=GetCallerPC
Does gosim strictly need linkname magic? Is there some approach to fixing Gosim
to work with either of the last two Go versions, given the new linkname restrictions
and/or updates? Have you been able to make Gosim work with Go 1.25 for instance?
Thanks!
Jason