Skip to content

Commit e3a3df1

Browse files
committed
linear: fix a test case
1 parent 342cb6f commit e3a3df1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/cache/v3/linear_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,7 @@ func TestLinearMixedWatches(t *testing.T) {
742742
assert.Equal(t, 2, c.NumResources())
743743

744744
sotwState := stream.NewStreamState(false, nil)
745+
sotwState.SetKnownResourceNamesAsList(testType, []string{"a", "b"})
745746
w := make(chan Response, 1)
746747
c.CreateWatch(&Request{ResourceNames: []string{"a", "b"}, TypeUrl: testType, VersionInfo: c.getVersion()}, sotwState, w)
747748
mustBlock(t, w)
@@ -754,7 +755,7 @@ func TestLinearMixedWatches(t *testing.T) {
754755
err = c.UpdateResources(map[string]types.Resource{"a": a}, nil)
755756
assert.NoError(t, err)
756757
// This behavior is currently invalid for cds and lds, but due to a current limitation of linear cache sotw implementation
757-
verifyResponse(t, w, c.getVersion(), 1)
758+
verifyResponse(t, w, c.getVersion(), 2)
758759
checkVersionMapNotSet(t, c)
759760

760761
c.CreateWatch(&Request{ResourceNames: []string{"a", "b"}, TypeUrl: testType, VersionInfo: c.getVersion()}, sotwState, w)
@@ -775,6 +776,6 @@ func TestLinearMixedWatches(t *testing.T) {
775776
assert.NoError(t, err)
776777
checkVersionMapSet(t, c)
777778

778-
verifyResponse(t, w, c.getVersion(), 0)
779+
verifyResponse(t, w, c.getVersion(), 1)
779780
verifyDeltaResponse(t, wd, nil, []string{"b"})
780781
}

0 commit comments

Comments
 (0)