MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / TestInvalidVectorIndex

Function TestInvalidVectorIndex

query/vector/vector_test.go:385–400  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

383}
384
385func TestInvalidVectorIndex(t *testing.T) {
386 dropPredicate("vtest")
387 schema := fmt.Sprintf(vectorSchemaWithIndex, "vtest", "4", "euclidan")
388 var err error
389 for retry := 0; retry < 10; retry++ {
390 err = client.Alter(context.Background(), &api.Operation{Schema: schema})
391 if err == nil {
392 require.Error(t, err)
393 }
394 if strings.Contains(err.Error(), "Can't create a vector index for euclidan") {
395 return
396 }
397 time.Sleep(time.Second)
398 }
399 require.Error(t, nil)
400}
401
402func TestVectorIndexRebuildWhenChange(t *testing.T) {
403 dropPredicate("vtest")

Callers

nothing calls this directly

Calls 3

AlterMethod · 0.80
dropPredicateFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected