(t *testing.T)
| 258 | } |
| 259 | |
| 260 | func TestSnapshot(t *testing.T) { |
| 261 | prevDefaultSnapshotCount := defaultSnapshotCount |
| 262 | prevSnapshotCatchUpEntriesN := snapshotCatchUpEntriesN |
| 263 | defaultSnapshotCount = 4 |
| 264 | snapshotCatchUpEntriesN = 4 |
| 265 | defer func() { |
| 266 | defaultSnapshotCount = prevDefaultSnapshotCount |
| 267 | snapshotCatchUpEntriesN = prevSnapshotCatchUpEntriesN |
| 268 | }() |
| 269 | |
| 270 | clus := newCluster(3) |
| 271 | defer clus.closeNoErrors(t) |
| 272 | |
| 273 | go func() { |
| 274 | clus.proposeC[0] <- "foo" |
| 275 | }() |
| 276 | |
| 277 | c := <-clus.commitC[0] |
| 278 | |
| 279 | select { |
| 280 | case <-clus.snapshotTriggeredC[0]: |
| 281 | t.Fatalf("snapshot triggered before applying done") |
| 282 | default: |
| 283 | } |
| 284 | close(c.applyDoneC) |
| 285 | <-clus.snapshotTriggeredC[0] |
| 286 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…