diff --git a/tests/e2e/crud/crud_test.go b/tests/e2e/crud/crud_test.go index 97e3428e08..196eda5f6e 100644 --- a/tests/e2e/crud/crud_test.go +++ b/tests/e2e/crud/crud_test.go @@ -420,6 +420,8 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { Train: ds.Train[updateFrom : updateFrom+updateNum], }, true, + 0, + false, 1, func(t *testing.T, status int32, msg string) error { t.Helper() @@ -455,6 +457,8 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { Train: ds.Train[updateFrom : updateFrom+updateNum], }, false, + 0, + false, 1, func(t *testing.T, status int32, msg string) error { t.Helper() @@ -507,6 +511,8 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { Train: ds.Train[updateFrom : updateFrom+updateNum], }, false, + 0, + false, 1, operation.DefaultStatusValidator, operation.ParseAndLogError, @@ -523,6 +529,8 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { Train: ds.Train[updateFrom : updateFrom+updateNum], }, false, + 0, + false, 1, func(t *testing.T, status int32, msg string) error { t.Helper() @@ -560,6 +568,28 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { Train: ds.Train[updateFrom : updateFrom+updateNum], }, true, + 0, + false, + 1, + operation.DefaultStatusValidator, + operation.ParseAndLogError, + ) + if err != nil { + t.Fatalf("an error occurred on #6: %s", err) + } + + ts := time.Now().UnixNano() + + // #7 run Update with the same vector as UpdateTimestampIfExists=true and check that it succeeds + err = op.UpdateWithParameters( + t, + ctx, + operation.Dataset{ + Train: ds.Train[updateFrom : updateFrom+updateNum], + }, + false, + ts, + true, 1, operation.DefaultStatusValidator, operation.ParseAndLogError, @@ -568,7 +598,7 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { t.Fatalf("an error occurred on #6: %s", err) } - // #7 remove the vector in 6 with SkipStrictExistCheck=false and check that it succeeds + // #8 remove the vector in 6 with SkipStrictExistCheck=false and check that it succeeds err = op.RemoveWithParameters( t, ctx, @@ -583,7 +613,7 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { t.Fatalf("an error occurred on #7: %s", err) } - // #8 removed the vector of 6 with SkipStrictExistCheck=false and confirmed that it became NotFound + // #9 removed the vector of 6 with SkipStrictExistCheck=false and confirmed that it became NotFound err = op.RemoveWithParameters( t, ctx, @@ -619,7 +649,7 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { t.Fatalf("an error occurred: %s", err) } - // #9 remove vector 6 with SkipStrictExistCheck=true and check that it also becomes NotFound + // #10 remove vector 6 with SkipStrictExistCheck=true and check that it also becomes NotFound err = op.RemoveWithParameters( t, ctx, @@ -653,7 +683,7 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { t.Fatalf("an error occurred: %s", err) } - // #10 execute Upsert with SkipStrictExistCheck=false and check that it succeeds + // #11 execute Upsert with SkipStrictExistCheck=false and check that it succeeds err = op.UpsertWithParameters( t, ctx, @@ -669,7 +699,7 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { t.Fatalf("an error occurred on #10: %s", err) } - // #11 executed Upsert with SkipStrictExistCheck=false using the same vector as 10 and confirmed that AlreadyExists was returned + // #12 executed Upsert with SkipStrictExistCheck=false using the same vector as 10 and confirmed that AlreadyExists was returned err = op.UpsertWithParameters( t, ctx, @@ -706,7 +736,7 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { t.Fatalf("an error occurred: %s", err) } - // #12 executed SkipStrictExistCheck=false using a different vector than 10 for Upsert and confirmed that it succeeded + // #13 executed SkipStrictExistCheck=false using a different vector than 10 for Upsert and confirmed that it succeeded err = op.UpsertWithParameters( t, ctx, @@ -722,7 +752,7 @@ func TestE2ECRUDWithSkipStrictExistCheck(t *testing.T) { t.Fatalf("an error occurred on #12: %s", err) } - // #13 executed SkipStrictExistCheck=true using the same vector as Upsert 12 and confirmed that it succeeded + // #14 executed SkipStrictExistCheck=true using the same vector as Upsert 12 and confirmed that it succeeded err = op.UpsertWithParameters( t, ctx, diff --git a/tests/e2e/operation/stream.go b/tests/e2e/operation/stream.go index 585039dc2b..2f65ce0a2a 100644 --- a/tests/e2e/operation/stream.go +++ b/tests/e2e/operation/stream.go @@ -722,6 +722,8 @@ func (c *client) Update(t *testing.T, ctx context.Context, ds Dataset) error { ctx, ds, false, + 0, + false, 1, DefaultStatusValidator, ParseAndLogError, @@ -733,6 +735,8 @@ func (c *client) UpdateWithParameters( ctx context.Context, ds Dataset, skipStrictExistCheck bool, + ts int64, + updateTs bool, offset int, svalidator StatusValidator, evalidator ErrorValidator, @@ -804,7 +808,9 @@ func (c *client) UpdateWithParameters( Vector: append(v[offset:], v[:offset]...), }, Config: &payload.Update_Config{ - SkipStrictExistCheck: skipStrictExistCheck, + SkipStrictExistCheck: skipStrictExistCheck, + Timestamp: ts, + UpdateTimestampIfExists: updateTs, }, }) if err != nil {