2727
2828IMG_URL = "https://picsum.photos/200/300.jpg"
2929SMALL_DATASET_URL = "https://storage.googleapis.com/lb-artifacts-testing-public/sdk_integration_test/potato.jpeg"
30+ DATA_ROW_PROCESSING_WAIT_TIMEOUT_SECONDS = 30
31+ DATA_ROW_PROCESSING_WAIT_SLEEP_INTERNAL_SECONDS = 3
3032
3133
3234class Environ (Enum ):
@@ -392,7 +394,7 @@ def initial_dataset(client, rand_gen):
392394
393395
394396@pytest .fixture
395- def project_with_ontology (project ):
397+ def project_with_empty_ontology (project ):
396398 editor = list (
397399 project .client .get_labeling_frontends (
398400 where = LabelingFrontend .name == "editor" ))[0 ]
@@ -402,13 +404,13 @@ def project_with_ontology(project):
402404
403405
404406@pytest .fixture
405- def configured_project (project_with_ontology , initial_dataset , rand_gen ,
407+ def configured_project (project_with_empty_ontology , initial_dataset , rand_gen ,
406408 image_url ):
407409 dataset = initial_dataset
408410 data_row_id = dataset .create_data_row (row_data = image_url ).uid
409- project = project_with_ontology
411+ project = project_with_empty_ontology
410412
411- project .create_batch (
413+ batch = project .create_batch (
412414 rand_gen (str ),
413415 [data_row_id ], # sample of data row objects
414416 5 # priority between 1(Highest) - 5(lowest)
@@ -417,6 +419,8 @@ def configured_project(project_with_ontology, initial_dataset, rand_gen,
417419
418420 yield project
419421
422+ batch .delete ()
423+
420424
421425@pytest .fixture
422426def configured_project_with_label (client , rand_gen , image_url , project , dataset ,
@@ -426,21 +430,19 @@ def configured_project_with_label(client, rand_gen, image_url, project, dataset,
426430 Additionally includes a create_label method for any needed extra labels
427431 One label is already created and yielded when using fixture
428432 """
429- start_time = time .time ()
430- project ._wait_until_data_rows_are_processed (data_row_ids = [data_row .uid ],
431- sleep_interval = 3 )
433+ project ._wait_until_data_rows_are_processed (
434+ data_row_ids = [data_row .uid ],
435+ wait_processing_max_seconds = DATA_ROW_PROCESSING_WAIT_TIMEOUT_SECONDS ,
436+ sleep_interval = DATA_ROW_PROCESSING_WAIT_SLEEP_INTERNAL_SECONDS )
432437
433438 project .create_batch (
434439 rand_gen (str ),
435440 [data_row .uid ], # sample of data row objects
436441 5 # priority between 1(Highest) - 5(lowest)
437442 )
438- print ("create_batch took: " , time .time () - start_time )
439443 ontology = _setup_ontology (project )
440- print ("setup ontology took: " , time .time () - start_time )
441444 label = _create_label (project , data_row , ontology ,
442445 wait_for_label_processing )
443- print ("create_label took: " , time .time () - start_time )
444446 yield [project , dataset , data_row , label ]
445447
446448 for label in project .labels ():
0 commit comments