@@ -63,6 +63,8 @@ const (
6363var (
6464 errMissingID = errors .New ("result missing ID" )
6565 errNegativeDistance = errors .New ("negative distance" )
66+ errGetWrongItem = errors .New ("get returned wrong item" )
67+ errVectorMismatch = errors .New ("retrieved vector mismatch" )
6668)
6769
6870// ---------------------------------------------------------------------------
@@ -207,7 +209,7 @@ func TestConcurrentUpsertsOverlappingIDs(t *testing.T) {
207209 storedVec := item .GetVector ()
208210 matched := false
209211 for _ , c := range candidates {
210- if vectorsApproxEqual (storedVec , c , 1e-5 ) {
212+ if vectorsApproxEqual (storedVec , c ) {
211213 matched = true
212214 break
213215 }
@@ -952,7 +954,7 @@ func TestConcurrentWritesToDifferentIndexes(t *testing.T) {
952954 continue
953955 }
954956 retrievedVec := retrieved .Results [0 ].GetVector ()
955- if ! vectorsApproxEqual (retrievedVec , data .vectors [checkIdx ], 1e-5 ) {
957+ if ! vectorsApproxEqual (retrievedVec , data .vectors [checkIdx ]) {
956958 t .Errorf ("Index '%s', ID '%s': vector mismatch — data routed to wrong index" ,
957959 data .name , data .ids [checkIdx ])
958960 }
@@ -1112,13 +1114,13 @@ func TestConcurrentWriteThenVerifyPerThread(t *testing.T) {
11121114 }
11131115 if len (resp .Results ) != 1 || resp .Results [0 ].GetId () != ids [0 ] {
11141116 mu .Lock ()
1115- errs = append (errs , fmt .Errorf ("goroutine %d: get returned wrong item " , gid ))
1117+ errs = append (errs , fmt .Errorf ("goroutine %d: %w " , gid , errGetWrongItem ))
11161118 mu .Unlock ()
11171119 return
11181120 }
1119- if ! vectorsApproxEqual (resp .Results [0 ].GetVector (), vectors [0 ], 1e-5 ) {
1121+ if ! vectorsApproxEqual (resp .Results [0 ].GetVector (), vectors [0 ]) {
11201122 mu .Lock ()
1121- errs = append (errs , fmt .Errorf ("goroutine %d: retrieved vector mismatch " , gid ))
1123+ errs = append (errs , fmt .Errorf ("goroutine %d: %w " , gid , errVectorMismatch ))
11221124 mu .Unlock ()
11231125 }
11241126 }(g )
@@ -1278,7 +1280,7 @@ func TestRapidRoundRobinAcrossIndexes(t *testing.T) {
12781280 if gErr != nil {
12791281 t .Fatalf ("get index %d: %v" , i , gErr )
12801282 }
1281- if len (got .Results ) != 1 || ! vectorsApproxEqual (got .Results [0 ].GetVector (), perIndexLastVecs [i ][0 ], 1e-5 ) {
1283+ if len (got .Results ) != 1 || ! vectorsApproxEqual (got .Results [0 ].GetVector (), perIndexLastVecs [i ][0 ]) {
12821284 t .Errorf ("Index %d: last-round vector mismatch" , i )
12831285 }
12841286 }
0 commit comments