mirror of https://github.com/status-im/consul.git
Merge pull request #8344 from hashicorp/dnephin/fix-flakes-in-stream
stream: handle empty event in TestEventSnapshot
This commit is contained in:
commit
a33a7a6fe2
|
@ -154,9 +154,10 @@ jobs:
|
|||
- run:
|
||||
name: go test -race
|
||||
command: |
|
||||
mkdir -p $TEST_RESULTS_DIR
|
||||
mkdir -p $TEST_RESULTS_DIR /tmp/jsonfile
|
||||
gotestsum \
|
||||
--format=short-verbose \
|
||||
--jsonfile /tmp/jsonfile/go-test-race.log \
|
||||
--junitfile $TEST_RESULTS_DIR/gotestsum-report.xml -- \
|
||||
-tags="$GOTAGS" -p 2 \
|
||||
-race -gcflags=all=-d=checkptr=0 \
|
||||
|
@ -168,6 +169,8 @@ jobs:
|
|||
path: *TEST_RESULTS_DIR
|
||||
- store_artifacts:
|
||||
path: *TEST_RESULTS_DIR
|
||||
- store_artifacts:
|
||||
path: /tmp/jsonfile
|
||||
|
||||
# split off a job for the API package since it is separate
|
||||
go-test-api:
|
||||
|
|
|
@ -121,6 +121,12 @@ func TestEventSnapshot(t *testing.T) {
|
|||
require.NoError(t, err,
|
||||
"current state: snapDone=%v snapIDs=%s updateIDs=%s", snapDone,
|
||||
snapIDs, updateIDs)
|
||||
if len(curItem.Events) == 0 {
|
||||
// An item without an error or events is a bufferItem.NextLink event.
|
||||
// A subscription handles this by proceeding to the next item,
|
||||
// so we do the same here.
|
||||
continue
|
||||
}
|
||||
e := curItem.Events[0]
|
||||
switch {
|
||||
case snapDone:
|
||||
|
|
Loading…
Reference in New Issue