TestCloseProposerInflight tests closing the producer while committed messages are being published to the client.
(t *testing.T)
| 151 | // TestCloseProposerInflight tests closing the producer while |
| 152 | // committed messages are being published to the client. |
| 153 | func TestCloseProposerInflight(t *testing.T) { |
| 154 | clus := newCluster(1) |
| 155 | defer clus.closeNoErrors(t) |
| 156 | |
| 157 | var wg sync.WaitGroup |
| 158 | wg.Add(1) |
| 159 | |
| 160 | // some inflight ops |
| 161 | go func() { |
| 162 | defer wg.Done() |
| 163 | clus.proposeC[0] <- "foo" |
| 164 | clus.proposeC[0] <- "bar" |
| 165 | }() |
| 166 | |
| 167 | // wait for one message |
| 168 | if c, ok := <-clus.commitC[0]; !ok || c.data[0] != "foo" { |
| 169 | t.Fatalf("Commit failed") |
| 170 | } |
| 171 | |
| 172 | wg.Wait() |
| 173 | } |
| 174 | |
| 175 | func TestPutAndGetKeyValue(t *testing.T) { |
| 176 | clusters := []string{"http://127.0.0.1:9021"} |
nothing calls this directly
no test coverage detected
searching dependent graphs…