March 2021
Intermediate to advanced
260 pages
5h 45m
English
Let’s test that our service discovery and replication works in an end-to-end test. We’ll set up a cluster with three nodes. We’ll produce a record to one server and verify that we can consume the message from the other servers that have (hopefully) replicated for us.
In internal/agent, create an agent_test.go file, beginning with this snippet:
| | package agent_test |
| | |
| | import ( |
| | "context" |
| | "crypto/tls" |
| | "fmt" |
| | "io/ioutil" |
| | "os" |
| | "testing" |
| | "time" |
| | |
| | "github.com/stretchr/testify/require" |
| | "github.com/travisjeffery/go-dynaport" |
| | "google.golang.org/grpc" |
| | "google.golang.org/grpc/credentials" |
| | |
| | api "github.com/travisjeffery/proglog/api/v1" ... |
Read now
Unlock full access