From 63ddb5f4fe85b71788ccf40565e8d224c0de3aaf Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 8 Jan 2026 15:28:12 +0100 Subject: [PATCH] Fix acceptance tests to use explicit job ID replacements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Captures job ID after deployment and adds to ACC_REPLS for runtime replacement. This prevents non-deterministic test failures when job IDs happen to match timestamp patterns (13-digit numbers starting with 1[78]). Updates 10 acceptance tests: - 9 in bundle/integration_whl/ - 1 in bundle/resources/clusters/run/spark_python_task Each test now: 1. Captures job ID with read_id.py after deployment 2. Adds job_id:JOB_ID mapping to ACC_REPLS 3. Expects [JOB_ID] instead of [NUMID] in Run URLs This follows the pattern established in bundle/resources/jobs/update. Discovered in integration test run 20806115883 where job ID 1719463871887 matched the timestamp regex and was incorrectly replaced with [UNIX_TIME_MILLIS] instead of [NUMID]. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- acceptance/bundle/integration_whl/base/output.txt | 4 ++-- acceptance/bundle/integration_whl/base/script | 5 +++++ acceptance/bundle/integration_whl/custom_params/output.txt | 2 +- acceptance/bundle/integration_whl/custom_params/script | 5 +++++ .../bundle/integration_whl/interactive_cluster/output.txt | 4 ++-- acceptance/bundle/integration_whl/interactive_cluster/script | 5 +++++ .../interactive_cluster_dynamic_version/output.txt | 4 ++-- .../interactive_cluster_dynamic_version/script | 5 +++++ .../integration_whl/interactive_single_user/output.txt | 4 ++-- .../bundle/integration_whl/interactive_single_user/script | 5 +++++ acceptance/bundle/integration_whl/serverless/output.txt | 4 ++-- acceptance/bundle/integration_whl/serverless/script | 5 +++++ .../integration_whl/serverless_custom_params/output.txt | 4 ++-- .../bundle/integration_whl/serverless_custom_params/script | 4 ++++ .../integration_whl/serverless_dynamic_version/output.txt | 4 ++-- .../bundle/integration_whl/serverless_dynamic_version/script | 5 +++++ acceptance/bundle/integration_whl/wrapper/output.txt | 2 +- acceptance/bundle/integration_whl/wrapper/script | 5 +++++ .../resources/clusters/run/spark_python_task/output.txt | 2 +- .../bundle/resources/clusters/run/spark_python_task/script | 5 +++++ 20 files changed, 66 insertions(+), 17 deletions(-) diff --git a/acceptance/bundle/integration_whl/base/output.txt b/acceptance/bundle/integration_whl/base/output.txt index 85be9d3f7c..492f9de963 100644 --- a/acceptance/bundle/integration_whl/base/output.txt +++ b/acceptance/bundle/integration_whl/base/output.txt @@ -39,7 +39,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" TERMINATED SUCCESS @@ -57,7 +57,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" TERMINATED SUCCESS diff --git a/acceptance/bundle/integration_whl/base/script b/acceptance/bundle/integration_whl/base/script index 7db0843b7e..ed2f0c2dc7 100644 --- a/acceptance/bundle/integration_whl/base/script +++ b/acceptance/bundle/integration_whl/base/script @@ -3,6 +3,11 @@ envsubst < databricks.yml.tmpl > databricks.yml trace cat databricks.yml trap "errcode trace '$CLI' bundle destroy --auto-approve" EXIT trace $CLI bundle deploy + +# Capture job ID and add to runtime replacements to avoid pattern matching ambiguity +job_id=$(read_id.py jobs some_other_job) +echo "$job_id:JOB_ID" >> ACC_REPLS + trace $CLI bundle run some_other_job title "Make a change to code without version change and run the job again" diff --git a/acceptance/bundle/integration_whl/custom_params/output.txt b/acceptance/bundle/integration_whl/custom_params/output.txt index b62f1a7543..a6af01bade 100644 --- a/acceptance/bundle/integration_whl/custom_params/output.txt +++ b/acceptance/bundle/integration_whl/custom_params/output.txt @@ -39,7 +39,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job --python-params param1,param2 -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" TERMINATED SUCCESS diff --git a/acceptance/bundle/integration_whl/custom_params/script b/acceptance/bundle/integration_whl/custom_params/script index 246c90ae05..4965e51ec0 100644 --- a/acceptance/bundle/integration_whl/custom_params/script +++ b/acceptance/bundle/integration_whl/custom_params/script @@ -4,4 +4,9 @@ cp -r $TESTDIR/../base/{$EXTRA_CONFIG,setup.py,my_test_code} . trace cat databricks.yml trap "errcode trace '$CLI' bundle destroy --auto-approve" EXIT trace $CLI bundle deploy + +# Capture job ID and add to runtime replacements to avoid pattern matching ambiguity +job_id=$(read_id.py jobs some_other_job) +echo "$job_id:JOB_ID" >> ACC_REPLS + trace $CLI bundle run some_other_job --python-params param1,param2 diff --git a/acceptance/bundle/integration_whl/interactive_cluster/output.txt b/acceptance/bundle/integration_whl/interactive_cluster/output.txt index 82d32968d8..e7342d0822 100644 --- a/acceptance/bundle/integration_whl/interactive_cluster/output.txt +++ b/acceptance/bundle/integration_whl/interactive_cluster/output.txt @@ -39,7 +39,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" TERMINATED SUCCESS @@ -57,7 +57,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" TERMINATED SUCCESS diff --git a/acceptance/bundle/integration_whl/interactive_cluster/script b/acceptance/bundle/integration_whl/interactive_cluster/script index 6224f1d245..c2de81b3a3 100644 --- a/acceptance/bundle/integration_whl/interactive_cluster/script +++ b/acceptance/bundle/integration_whl/interactive_cluster/script @@ -3,6 +3,11 @@ envsubst < databricks.yml.tmpl > databricks.yml trace cat databricks.yml trap "errcode trace '$CLI' bundle destroy --auto-approve" EXIT trace $CLI bundle deploy + +# Capture job ID and add to runtime replacements to avoid pattern matching ambiguity +job_id=$(read_id.py jobs some_other_job) +echo "$job_id:JOB_ID" >> ACC_REPLS + trace $CLI bundle run some_other_job title "Make a change to code without version change and run the job again" diff --git a/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/output.txt b/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/output.txt index 8565d67853..c0ffe33e07 100644 --- a/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/output.txt +++ b/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/output.txt @@ -8,7 +8,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" TERMINATED SUCCESS @@ -26,7 +26,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" TERMINATED SUCCESS diff --git a/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/script b/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/script index e59d0c0dad..205ca99492 100644 --- a/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/script +++ b/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/script @@ -2,6 +2,11 @@ envsubst < databricks.yml.tmpl > databricks.yml cp -r $TESTDIR/../interactive_cluster/{setup.py,my_test_code} . trap "errcode trace '$CLI' bundle destroy --auto-approve" EXIT trace $CLI bundle deploy + +# Capture job ID and add to runtime replacements to avoid pattern matching ambiguity +job_id=$(read_id.py jobs some_other_job) +echo "$job_id:JOB_ID" >> ACC_REPLS + trace $CLI bundle run some_other_job title "Make a change to code without version change and run the job again" diff --git a/acceptance/bundle/integration_whl/interactive_single_user/output.txt b/acceptance/bundle/integration_whl/interactive_single_user/output.txt index 4b45d9526c..11f817fc7f 100644 --- a/acceptance/bundle/integration_whl/interactive_single_user/output.txt +++ b/acceptance/bundle/integration_whl/interactive_single_user/output.txt @@ -39,7 +39,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" TERMINATED SUCCESS @@ -54,7 +54,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" TERMINATED SUCCESS diff --git a/acceptance/bundle/integration_whl/interactive_single_user/script b/acceptance/bundle/integration_whl/interactive_single_user/script index 20f089b4fb..eb4ca44694 100644 --- a/acceptance/bundle/integration_whl/interactive_single_user/script +++ b/acceptance/bundle/integration_whl/interactive_single_user/script @@ -4,6 +4,11 @@ trace cat databricks.yml cp -r $TESTDIR/../interactive_cluster/{setup.py,my_test_code} . trap "errcode trace '$CLI' bundle destroy --auto-approve" EXIT trace $CLI bundle deploy + +# Capture job ID and add to runtime replacements to avoid pattern matching ambiguity +job_id=$(read_id.py jobs some_other_job) +echo "$job_id:JOB_ID" >> ACC_REPLS + trace $CLI bundle run some_other_job > out.$DATABRICKS_BUNDLE_ENGINE.txt title "Make a change to code without version change and run the job again" diff --git a/acceptance/bundle/integration_whl/serverless/output.txt b/acceptance/bundle/integration_whl/serverless/output.txt index 7043081fa9..fef6968b16 100644 --- a/acceptance/bundle/integration_whl/serverless/output.txt +++ b/acceptance/bundle/integration_whl/serverless/output.txt @@ -10,7 +10,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "My Wheel Job" RUNNING [TIMESTAMP] "My Wheel Job" TERMINATED SUCCESS @@ -28,7 +28,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "My Wheel Job" RUNNING [TIMESTAMP] "My Wheel Job" TERMINATED SUCCESS diff --git a/acceptance/bundle/integration_whl/serverless/script b/acceptance/bundle/integration_whl/serverless/script index 529be3ee7e..1d3ae37524 100644 --- a/acceptance/bundle/integration_whl/serverless/script +++ b/acceptance/bundle/integration_whl/serverless/script @@ -2,6 +2,11 @@ envsubst < databricks.yml.tmpl > databricks.yml trace cp -r $TESTDIR/../base/{setup.py,my_test_code} . trap "errcode trace '$CLI' bundle destroy --auto-approve" EXIT trace $CLI bundle deploy + +# Capture job ID and add to runtime replacements to avoid pattern matching ambiguity +job_id=$(read_id.py jobs some_other_job) +echo "$job_id:JOB_ID" >> ACC_REPLS + trace $CLI bundle run some_other_job title "Make a change to code without version change and run the job again" diff --git a/acceptance/bundle/integration_whl/serverless_custom_params/output.txt b/acceptance/bundle/integration_whl/serverless_custom_params/output.txt index 6b750ca6e7..a42aa87323 100644 --- a/acceptance/bundle/integration_whl/serverless_custom_params/output.txt +++ b/acceptance/bundle/integration_whl/serverless_custom_params/output.txt @@ -8,7 +8,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job With Environments [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job With Environments [UNIQUE_NAME]" TERMINATED SUCCESS @@ -17,7 +17,7 @@ Got arguments: ['my_test_code', 'one', 'two'] >>> [CLI] bundle run some_other_job --python-params=param1,param2 -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job With Environments [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job With Environments [UNIQUE_NAME]" TERMINATED SUCCESS diff --git a/acceptance/bundle/integration_whl/serverless_custom_params/script b/acceptance/bundle/integration_whl/serverless_custom_params/script index 20578c4a0f..68d7f522c3 100644 --- a/acceptance/bundle/integration_whl/serverless_custom_params/script +++ b/acceptance/bundle/integration_whl/serverless_custom_params/script @@ -7,5 +7,9 @@ trap cleanup EXIT trace $CLI bundle deploy +# Capture job ID and add to runtime replacements to avoid pattern matching ambiguity +job_id=$(read_id.py jobs some_other_job) +echo "$job_id:JOB_ID" >> ACC_REPLS + trace $CLI bundle run some_other_job trace $CLI bundle run some_other_job --python-params=param1,param2 diff --git a/acceptance/bundle/integration_whl/serverless_dynamic_version/output.txt b/acceptance/bundle/integration_whl/serverless_dynamic_version/output.txt index c08ad6eb0b..8c639743f6 100644 --- a/acceptance/bundle/integration_whl/serverless_dynamic_version/output.txt +++ b/acceptance/bundle/integration_whl/serverless_dynamic_version/output.txt @@ -10,7 +10,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "My Wheel Job" RUNNING [TIMESTAMP] "My Wheel Job" TERMINATED SUCCESS @@ -28,7 +28,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "My Wheel Job" RUNNING [TIMESTAMP] "My Wheel Job" TERMINATED SUCCESS diff --git a/acceptance/bundle/integration_whl/serverless_dynamic_version/script b/acceptance/bundle/integration_whl/serverless_dynamic_version/script index 529be3ee7e..1d3ae37524 100644 --- a/acceptance/bundle/integration_whl/serverless_dynamic_version/script +++ b/acceptance/bundle/integration_whl/serverless_dynamic_version/script @@ -2,6 +2,11 @@ envsubst < databricks.yml.tmpl > databricks.yml trace cp -r $TESTDIR/../base/{setup.py,my_test_code} . trap "errcode trace '$CLI' bundle destroy --auto-approve" EXIT trace $CLI bundle deploy + +# Capture job ID and add to runtime replacements to avoid pattern matching ambiguity +job_id=$(read_id.py jobs some_other_job) +echo "$job_id:JOB_ID" >> ACC_REPLS + trace $CLI bundle run some_other_job title "Make a change to code without version change and run the job again" diff --git a/acceptance/bundle/integration_whl/wrapper/output.txt b/acceptance/bundle/integration_whl/wrapper/output.txt index 37c7c1d078..cd2a3e321e 100644 --- a/acceptance/bundle/integration_whl/wrapper/output.txt +++ b/acceptance/bundle/integration_whl/wrapper/output.txt @@ -39,7 +39,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run some_other_job -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" RUNNING [TIMESTAMP] "[default] Test Wheel Job [UNIQUE_NAME]" TERMINATED SUCCESS diff --git a/acceptance/bundle/integration_whl/wrapper/script b/acceptance/bundle/integration_whl/wrapper/script index 68ca611cac..67a081309e 100644 --- a/acceptance/bundle/integration_whl/wrapper/script +++ b/acceptance/bundle/integration_whl/wrapper/script @@ -9,4 +9,9 @@ cp -r $TESTDIR/../base/{$EXTRA_CONFIG,setup.py,my_test_code} . trace cat databricks.yml trap "errcode trace '$CLI' bundle destroy --auto-approve" EXIT trace $CLI bundle deploy + +# Capture job ID and add to runtime replacements to avoid pattern matching ambiguity +job_id=$(read_id.py jobs some_other_job) +echo "$job_id:JOB_ID" >> ACC_REPLS + trace $CLI bundle run some_other_job diff --git a/acceptance/bundle/resources/clusters/run/spark_python_task/output.txt b/acceptance/bundle/resources/clusters/run/spark_python_task/output.txt index 2354b0ec6e..2bc904366f 100644 --- a/acceptance/bundle/resources/clusters/run/spark_python_task/output.txt +++ b/acceptance/bundle/resources/clusters/run/spark_python_task/output.txt @@ -10,7 +10,7 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run foo -Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[NUMID]/run/[NUMID] +Run URL: [DATABRICKS_URL]/?o=[NUMID]#job/[JOB_ID]/run/[NUMID] [TIMESTAMP] "test-job-with-cluster-[UNIQUE_NAME]" RUNNING [TIMESTAMP] "test-job-with-cluster-[UNIQUE_NAME]" TERMINATED SUCCESS diff --git a/acceptance/bundle/resources/clusters/run/spark_python_task/script b/acceptance/bundle/resources/clusters/run/spark_python_task/script index 82408ac5d9..627b5cfe82 100644 --- a/acceptance/bundle/resources/clusters/run/spark_python_task/script +++ b/acceptance/bundle/resources/clusters/run/spark_python_task/script @@ -8,4 +8,9 @@ cleanup() { trap cleanup EXIT trace $CLI bundle deploy + +# Capture job ID and add to runtime replacements to avoid pattern matching ambiguity +job_id=$(read_id.py jobs foo) +echo "$job_id:JOB_ID" >> ACC_REPLS + trace $CLI bundle run foo