@@ -40,6 +40,8 @@ def query_and_check_equals(index, queries, expected_result_d, expected_result_i)
4040
4141
4242def test_vamana_ingestion_u8 (tmp_path ):
43+ vfs = tiledb .VFS ()
44+
4345 dataset_dir = os .path .join (tmp_path , "dataset" )
4446 index_uri = os .path .join (tmp_path , "array" )
4547 if os .path .exists (index_uri ):
@@ -64,6 +66,10 @@ def test_vamana_ingestion_u8(tmp_path):
6466 _ , result = index_ram .query (queries , k = k )
6567 assert accuracy (result , gt_i ) > MINIMUM_ACCURACY
6668
69+ assert vfs .dir_size (index_uri ) > 0
70+ Index .delete_index (uri = index_uri , config = {})
71+ assert vfs .dir_size (index_uri ) == 0
72+
6773
6874def test_flat_ingestion_u8 (tmp_path ):
6975 dataset_dir = os .path .join (tmp_path , "dataset" )
@@ -245,6 +251,8 @@ def test_ivf_flat_ingestion_f32(tmp_path):
245251
246252
247253def test_ingestion_fvec (tmp_path ):
254+ vfs = tiledb .VFS ()
255+
248256 source_uri = siftsmall_inputs_file
249257 queries_uri = siftsmall_query_file
250258 gt_uri = siftsmall_groundtruth_file
@@ -289,8 +297,14 @@ def test_ingestion_fvec(tmp_path):
289297 _ , result = index_ram .query (queries , k = k , nprobe = nprobe , mode = Mode .LOCAL )
290298 assert accuracy (result , gt_i ) > MINIMUM_ACCURACY
291299
300+ assert vfs .dir_size (index_uri ) > 0
301+ Index .delete_index (uri = index_uri , config = {})
302+ assert vfs .dir_size (index_uri ) == 0
303+
292304
293305def test_ingestion_numpy (tmp_path ):
306+ vfs = tiledb .VFS ()
307+
294308 source_uri = siftsmall_inputs_file
295309 queries_uri = siftsmall_query_file
296310 gt_uri = siftsmall_groundtruth_file
@@ -336,8 +350,14 @@ def test_ingestion_numpy(tmp_path):
336350 _ , result = index_ram .query (queries , k = k , nprobe = nprobe , mode = Mode .LOCAL )
337351 assert accuracy (result , gt_i ) > MINIMUM_ACCURACY
338352
353+ assert vfs .dir_size (index_uri ) > 0
354+ Index .delete_index (uri = index_uri , config = {})
355+ assert vfs .dir_size (index_uri ) == 0
356+
339357
340358def test_ingestion_numpy_i8 (tmp_path ):
359+ vfs = tiledb .VFS ()
360+
341361 source_uri = siftsmall_inputs_file
342362 queries_uri = siftsmall_query_file
343363 gt_uri = siftsmall_groundtruth_file
@@ -384,8 +404,14 @@ def test_ingestion_numpy_i8(tmp_path):
384404 _ , result = index_ram .query (queries , k = k , nprobe = nprobe , mode = Mode .LOCAL )
385405 assert accuracy (result , gt_i ) > MINIMUM_ACCURACY
386406
407+ assert vfs .dir_size (index_uri ) > 0
408+ Index .delete_index (uri = index_uri , config = {})
409+ assert vfs .dir_size (index_uri ) == 0
410+
387411
388412def test_ingestion_multiple_workers (tmp_path ):
413+ vfs = tiledb .VFS ()
414+
389415 source_uri = siftsmall_inputs_file
390416 queries_uri = siftsmall_query_file
391417 gt_uri = siftsmall_groundtruth_file
@@ -432,8 +458,14 @@ def test_ingestion_multiple_workers(tmp_path):
432458 _ , result = index_ram .query (queries , k = k , nprobe = nprobe , mode = Mode .LOCAL )
433459 assert accuracy (result , gt_i ) > MINIMUM_ACCURACY
434460
461+ assert vfs .dir_size (index_uri ) > 0
462+ Index .delete_index (uri = index_uri , config = {})
463+ assert vfs .dir_size (index_uri ) == 0
464+
435465
436466def test_ingestion_external_ids_numpy (tmp_path ):
467+ vfs = tiledb .VFS ()
468+
437469 source_uri = siftsmall_inputs_file
438470 queries_uri = siftsmall_query_file
439471 gt_uri = siftsmall_groundtruth_file
@@ -474,8 +506,14 @@ def test_ingestion_external_ids_numpy(tmp_path):
474506 _ , result = index_ram .query (queries , k = k , nprobe = nprobe )
475507 assert accuracy (result , gt_i , external_ids_offset ) > MINIMUM_ACCURACY
476508
509+ assert vfs .dir_size (index_uri ) > 0
510+ Index .delete_index (uri = index_uri , config = {})
511+ assert vfs .dir_size (index_uri ) == 0
512+
477513
478514def test_ingestion_with_updates (tmp_path ):
515+ vfs = tiledb .VFS ()
516+
479517 dataset_dir = os .path .join (tmp_path , "dataset" )
480518 k = 10
481519 size = 1000
@@ -528,8 +566,14 @@ def test_ingestion_with_updates(tmp_path):
528566 _ , result = index .query (queries , k = k , nprobe = 20 )
529567 assert accuracy (result , gt_i , updated_ids = updated_ids ) == 1.0
530568
569+ assert vfs .dir_size (index_uri ) > 0
570+ Index .delete_index (uri = index_uri , config = {})
571+ assert vfs .dir_size (index_uri ) == 0
572+
531573
532574def test_ingestion_with_batch_updates (tmp_path ):
575+ vfs = tiledb .VFS ()
576+
533577 dataset_dir = os .path .join (tmp_path , "dataset" )
534578 k = 10
535579 size = 100000
@@ -590,8 +634,14 @@ def test_ingestion_with_batch_updates(tmp_path):
590634 _ , result = index .query (queries , k = k , nprobe = nprobe )
591635 assert accuracy (result , gt_i , updated_ids = updated_ids ) > 0.99
592636
637+ assert vfs .dir_size (index_uri ) > 0
638+ Index .delete_index (uri = index_uri , config = {})
639+ assert vfs .dir_size (index_uri ) == 0
640+
593641
594642def test_ingestion_with_updates_and_timetravel (tmp_path ):
643+ vfs = tiledb .VFS ()
644+
595645 dataset_dir = os .path .join (tmp_path , "dataset" )
596646 k = 10
597647 size = 1000
@@ -819,8 +869,14 @@ def test_ingestion_with_updates_and_timetravel(tmp_path):
819869 _ , result = index .query (queries , k = k , nprobe = partitions )
820870 assert accuracy (result , gt_i , updated_ids = updated_ids ) == 0.0
821871
872+ assert vfs .dir_size (index_uri ) > 0
873+ Index .delete_index (uri = index_uri , config = {})
874+ assert vfs .dir_size (index_uri ) == 0
875+
822876
823877def test_ingestion_with_additions_and_timetravel (tmp_path ):
878+ vfs = tiledb .VFS ()
879+
824880 dataset_dir = os .path .join (tmp_path , "dataset" )
825881 k = 100
826882 size = 100
@@ -868,6 +924,10 @@ def test_ingestion_with_additions_and_timetravel(tmp_path):
868924 _ , result = index .query (queries , k = k , nprobe = partitions , opt_l = k * 2 )
869925 assert 0.45 < accuracy (result , gt_i )
870926
927+ assert vfs .dir_size (index_uri ) > 0
928+ Index .delete_index (uri = index_uri , config = {})
929+ assert vfs .dir_size (index_uri ) == 0
930+
871931
872932def test_ivf_flat_ingestion_tdb_random_sampling_policy (tmp_path ):
873933 dataset_dir = os .path .join (tmp_path , "dataset" )
0 commit comments