2020from devtools_testutils import (
2121 recorded_by_proxy ,
2222 RecordedTransport ,
23- is_live_and_not_recording ,
23+ is_live
2424)
2525from azure .mgmt .cognitiveservices import CognitiveServicesManagementClient
2626from azure .mgmt .cognitiveservices .models import Deployment , DeploymentProperties , DeploymentModel , Sku
@@ -346,8 +346,9 @@ def _test_deploy_and_infer_helper(
346346 print (f"[{ test_prefix } ] Deployment status: { deployment_operation .status ()} " )
347347
348348 print (f"[{ test_prefix } ] Deployment completed successfully" )
349- print (f"[{ test_prefix } ] Waiting for 120 seconds for deployment to be fully ready." )
350- time .sleep (120 )
349+ if is_live ():
350+ print (f"[{ test_prefix } ] Waiting for 10 minutes for deployment to be fully ready." )
351+ time .sleep (600 )
351352 print (f"[{ test_prefix } ] Testing inference on deployment: { deployment_name } " )
352353
353354 response = openai_client .responses .create (
@@ -622,10 +623,6 @@ def test_finetuning_list_events(self, **kwargs):
622623 self ._cleanup_test_file (openai_client , train_file .id )
623624 self ._cleanup_test_file (openai_client , validation_file .id )
624625
625- @pytest .mark .skipif (
626- condition = (not is_live_and_not_recording ()),
627- reason = "Skipped because not able to pause any job" ,
628- )
629626 @servicePreparer ()
630627 @recorded_by_proxy (RecordedTransport .AZURE_CORE , RecordedTransport .HTTPX )
631628 def test_finetuning_pause_job (self , ** kwargs ):
@@ -658,10 +655,6 @@ def test_finetuning_pause_job(self, **kwargs):
658655
659656 print (f"[test_finetuning_pause_job] Successfully paused and verified job: { running_job_id } " )
660657
661- @pytest .mark .skipif (
662- condition = (not is_live_and_not_recording ()),
663- reason = "Skipped because not able to pause any job" ,
664- )
665658 @servicePreparer ()
666659 @recorded_by_proxy (RecordedTransport .AZURE_CORE , RecordedTransport .HTTPX )
667660 def test_finetuning_resume_job (self , ** kwargs ):
@@ -733,10 +726,6 @@ def test_finetuning_list_checkpoints(self, **kwargs):
733726 f"[test_finetuning_list_checkpoints] Successfully validated { len (checkpoints_list )} checkpoints for job: { completed_job_id } "
734727 )
735728
736- @pytest .mark .skipif (
737- condition = (not is_live_and_not_recording ()),
738- reason = "Skipped because API not sending completed or failed status despite job being complete" ,
739- )
740729 @servicePreparer ()
741730 @recorded_by_proxy (RecordedTransport .AZURE_CORE , RecordedTransport .HTTPX )
742731 def test_finetuning_deploy_and_infer_oai_model_sft_job (self , ** kwargs ):
@@ -750,12 +739,8 @@ def test_finetuning_deploy_and_infer_oai_model_sft_job(self, **kwargs):
750739 ** kwargs ,
751740 )
752741
753- @pytest .mark .skipif (
754- condition = (not is_live_and_not_recording ()),
755- reason = "Skipped because not able to complete any RFT job" ,
756- )
757742 @servicePreparer ()
758- @recorded_by_proxy
743+ @recorded_by_proxy ( RecordedTransport . AZURE_CORE , RecordedTransport . HTTPX )
759744 def test_finetuning_deploy_and_infer_oai_model_rft_job (self , ** kwargs ):
760745 completed_job_id = kwargs .get ("azure_ai_projects_tests_completed_oai_model_rft_fine_tuning_job_id" )
761746 self ._test_deploy_and_infer_helper (
@@ -767,10 +752,6 @@ def test_finetuning_deploy_and_infer_oai_model_rft_job(self, **kwargs):
767752 ** kwargs ,
768753 )
769754
770- @pytest .mark .skipif (
771- condition = (not is_live_and_not_recording ()),
772- reason = "Skipped because API not sending completed or failed status despite job being complete" ,
773- )
774755 @servicePreparer ()
775756 @recorded_by_proxy (RecordedTransport .AZURE_CORE , RecordedTransport .HTTPX )
776757 def test_finetuning_deploy_and_infer_oai_model_dpo_job (self , ** kwargs ):
@@ -784,10 +765,6 @@ def test_finetuning_deploy_and_infer_oai_model_dpo_job(self, **kwargs):
784765 ** kwargs ,
785766 )
786767
787- @pytest .mark .skipif (
788- condition = (not is_live_and_not_recording ()),
789- reason = "Skipped because API not sending completed or failed status despite job being complete" ,
790- )
791768 @servicePreparer ()
792769 @recorded_by_proxy (RecordedTransport .AZURE_CORE , RecordedTransport .HTTPX )
793770 def test_finetuning_deploy_and_infer_oss_model_sft_job (self , ** kwargs ):
0 commit comments