Repository navigation
[DeID] Surface job errors in live test failures; random live job names - #49626
Closed
Josiah Vinson (jovinson-ms) wants to merge 2 commits into
Closed
Josiah Vinson (jovinson-ms) wants to merge 2 commits into
Josiah Vinson (jovinson-ms) wants to merge 2 commits into
Conversation
- Add wait_for_job/wait_for_job_async test helpers that report job status, error, summary, and unsuccessful documents instead of azure-core's generic 'Operation returned an invalid status OK', and fail explicitly when the job is not terminal after the timeout (now 600s). - Generate a fresh uniquifier for every live run (including AZURE_SKIP_LIVE_RECORDING); only persist it when recording. - Samples print job.error before re-raising on job failure. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 40cdcc81-accc-4b2e-af24-fd79c6480740
|
Azure Pipelines: Successfully started running 1 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 40cdcc81-accc-4b2e-af24-fd79c6480740
Member
Author
|
Copilot on behalf of Josiah Vinson (@jovinson-ms): combined into #49627. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Live runs of
azure-health-deidentification(test_create_wait_finish,test_create_wait_finish_async,test_list_job_docs_pagination,deidentify_documents_async.py) kept failing withHttpResponseError: Operation returned an invalid status 'OK'. That message is how azure-core LRO polling reports a job that reachedFailed. It hid the actual job and document errors, so the underlying service issue went undiagnosed for weeks.Two related problems:
AZURE_SKIP_LIVE_RECORDING=True, so every live run reused the checked-inuniquifier.confvalue. Any live runs that share resources would then try to create jobs with the same names.Runningafterresult(timeout=120): a past build failed because the job was stillRunningafter this call. This is not an SDK bug.LROPoller.result(timeout)returns the current resource once the timeout expires, and the generated polling config and DeID's terminal states are correct. The tests just never checked whether the poller had finished.Fix
tests/deid_base_test_case.pyaddswait_for_job/wait_for_job_async.HttpResponseError/OperationFailedthey fetch the job and fail with its status,job.error, summary counts, and up to 20 non-succeeded documents with their errors.tests/conftest.py: every live run gets a random uniquifier;AZURE_TEST_KEEP_UNIQUIFIERopts out. It is written touniquifier.confonly when recording, so playback stays deterministic.deidentify_documentsandlist_job_documents, sync and async, printJob <name> ended with status <status>: <error>and re-raise on failure. The async samples also close their credential.Validation
pytest testspassed 13/13 after rebasing on currentmain, andblack --check -l 120made no changes.New-TestResources.ps1and torn down afterwards. The package did not change onmainbetween that run and the rebase.test_exception_throwshit a transient Azure CLI credential failure on the first attempt and passed on rerun.AZURE_TEST_USE_CLI_AUTH=truelocally; that setting is not part of this commit.result(timeout=60/120), matching the README. If the service is slow they can return a job that is still running.Note
A sibling PR (stale codegen + lint fix for this package) also edits
tests/conftest.py, so a merge conflict is possible depending on which PR merges first.Created by Copilot on behalf of Josiah Vinson (Josiah Vinson (@jovinson-ms))