Skip to content

Comments

Disable rate limit for local acceptance tests; increase for cloud#3581

Merged
denik merged 1 commit intomainfrom
denik/rate-limit-acc-tests
Sep 10, 2025
Merged

Disable rate limit for local acceptance tests; increase for cloud#3581
denik merged 1 commit intomainfrom
denik/rate-limit-acc-tests

Conversation

@denik
Copy link
Contributor

@denik denik commented Sep 9, 2025

Changes

Respect DATABRICKS_RATE_LIMIT variable and pass it to tests if set.

If not set, set to higher defaults depending on local/cloud.

Related: #3579

Tests

New acc test with parallel resources that is good to demo the difference. Manually try different rate limits:

Set a very low limit:

~/work/cli-main/acceptance/bundle/resources/independent % DATABRICKS_RATE_LIMIT=1 testme -v -count=1
+ go test ../../.. -run ^TestAccept$/^bundle$/^resources$/^independent$ -v -count=1
…
        --- PASS: TestAccept/bundle/resources/independent/DATABRICKS_CLI_DEPLOYMENT=direct-exp (16.47s)
        --- PASS: TestAccept/bundle/resources/independent/DATABRICKS_CLI_DEPLOYMENT=terraform (22.34s)

Restore SDK default:

~/work/cli-main/acceptance/bundle/resources/independent % DATABRICKS_RATE_LIMIT=15 testme -v -count=1
+ go test ../../.. -run ^TestAccept$/^bundle$/^resources$/^independent$ -v -count=1
        --- PASS: TestAccept/bundle/resources/independent/DATABRICKS_CLI_DEPLOYMENT=direct-exp (1.52s)
        --- PASS: TestAccept/bundle/resources/independent/DATABRICKS_CLI_DEPLOYMENT=terraform (5.02s)

New default:

~/work/cli-main/acceptance/bundle/resources/independent % testme -v -count=1
+ go test ../../.. -run ^TestAccept$/^bundle$/^resources$/^independent$ -v -count=1
        --- PASS: TestAccept/bundle/resources/independent/DATABRICKS_CLI_DEPLOYMENT=direct-exp (0.46s)
        --- PASS: TestAccept/bundle/resources/independent/DATABRICKS_CLI_DEPLOYMENT=terraform (2.36s)

Respect DATABRICKS_RATE_LIMIT variable and pass it to tests if set.

If not set, set to higher defaults depending on local/cloud.
@denik denik force-pushed the denik/rate-limit-acc-tests branch from 599d741 to dc83470 Compare September 9, 2025 19:05
@denik denik temporarily deployed to test-trigger-is September 9, 2025 19:05 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Sep 9, 2025

Run: 17593002695

Env ✅​pass 🔄​flaky 🙈​skip
✅​ aws linux 311 526
✅​ aws windows 312 525
🔄​ aws-ucws linux 414 9 424
🔄​ aws-ucws windows 415 9 423
✅​ azure linux 311 525
✅​ azure windows 312 524
🔄​ azure-ucws linux 415 8 423
✅​ azure-ucws windows 424 422
🔄​ gcp linux 308 2 527
🔄​ gcp windows 306 5 526
16 failing tests:
Test Name aws-ucws linux aws-ucws windows azure-ucws linux gcp linux gcp windows
TestAccept ✅​pass ✅​pass ✅​pass ✅​pass 🔄​flaky
TestAccept/bundle/deploy/dashboard/detect-change 🔄​flaky 🔄​flaky 🔄​flaky ✅​pass ✅​pass
TestAccept/bundle/deploy/dashboard/generate_inplace 🔄​flaky 🔄​flaky 🔄​flaky ✅​pass ✅​pass
TestAccept/bundle/deploy/dashboard/nested-folders 🔄​flaky 🔄​flaky 🔄​flaky ✅​pass ✅​pass
TestAccept/bundle/deploy/dashboard/simple 🔄​flaky 🔄​flaky 🔄​flaky ✅​pass ✅​pass
TestAccept/bundle/deploy/dashboard/simple_outside_bundle_root 🔄​flaky 🔄​flaky 🔄​flaky ✅​pass ✅​pass
TestAccept/bundle/deploy/dashboard/simple_syncroot 🔄​flaky 🔄​flaky 🔄​flaky ✅​pass ✅​pass
TestAccept/bundle/deployment/bind/dashboard 🔄​flaky 🔄​flaky 🔄​flaky ✅​pass ✅​pass
TestAccept/bundle/deployment/bind/dashboard/recreation 🔄​flaky 🔄​flaky ✅​pass ✅​pass ✅​pass
TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_CLI_DEPLOYMENT=direct-exp ✅​pass ✅​pass ✅​pass 🔄​flaky ✅​pass
TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_CLI_DEPLOYMENT=terraform ✅​pass ✅​pass ✅​pass 🔄​flaky ✅​pass
TestAccept/bundle/templates/default-python/integration_classic ✅​pass ✅​pass ✅​pass ✅​pass 🔄​flaky
TestAccept/bundle/templates/default-python/integration_classic/DATABRICKS_CLI_DEPLOYMENT=direct-exp/UV_PYTHON=3.9 ✅​pass ✅​pass ✅​pass ✅​pass 🔄​flaky
TestDashboardAssumptions_WorkspaceImport 🔄​flaky 🔄​flaky 🔄​flaky ✅​pass ✅​pass
TestWorkspaceFilesExtensions_ExportFormatIsPreserved ✅​pass ✅​pass ✅​pass ✅​pass 🔄​flaky
TestWorkspaceFilesExtensions_ExportFormatIsPreserved/source_r ✅​pass ✅​pass ✅​pass ✅​pass 🔄​flaky

@denik denik added this pull request to the merge queue Sep 10, 2025
Merged via the queue into main with commit faebed1 Sep 10, 2025
13 checks passed
@denik denik deleted the denik/rate-limit-acc-tests branch September 10, 2025 14:51
denik added a commit that referenced this pull request Sep 11, 2025
This happens sometimes

```
=== FAIL: acceptance TestAccept/bundle/upload/internal_server_error/DATABRICKS_CLI_DEPLOYMENT=direct-exp (0.05s)
    acceptance_test.go:1328: No effective updates from BundleConfig.default_name
    server.go:59: Failed to read request body: unexpected EOF
```

Reproducible with:
`go test ./acceptance -run
^TestAccept$/^bundle$/^upload$/^internal_server_error$ -v -count=100
-failfast`

The issue started after disabling rate limit in acc tests
#3581
if I restore the rate limit, it does not fail even without this patch:

`DATABRICKS_RATE_LIMIT=15 go test ./acceptance -run
^TestAccept$/^bundle$/^upload$/^internal_server_error$/direct -v
-count=100 -failfast` succeeds.
denik added a commit that referenced this pull request Sep 11, 2025
After rate limit was disabled in
#3581 this test became flaky.

The ApplyParallel lines are already logged in order but the output of
those mutator appears as it comes.

This PR filters out the SDK request traces + request in question that
can change order.

```
=== FAIL: acceptance TestAccept/bundle/debuglog/DATABRICKS_CLI_DEPLOYMENT=direct-exp (0.04s)
    acceptance_test.go:1336: Writing updated bundle config to databricks.yml. BundleConfig sections: default_name
    acceptance_test.go:803: Diff:
        --- bundle/debuglog/out.stderr.direct-exp.txt
        +++ /tmp/TestAcceptbundledebuglogDATABRICKS_CLI_DEPLOYMENT=direct-exp1521238718/001/out.stderr.direct-exp.txt
        @@ -70,8 +70,6 @@
         10:07:59 Debug: ApplyParallel pid=12345 mutator=validate:folder_permissions
         10:07:59 Debug: ApplyParallel pid=12345 mutator=validate:validate_sync_patterns
         10:07:59 Debug: ApplyParallel pid=12345 mutator=fast_validate(readonly) mutator=validate:job_cluster_key_defined
        -10:07:59 Debug: ApplyParallel pid=12345 mutator=fast_validate(readonly) mutator=validate:job_task_cluster_spec
        -10:07:59 Debug: ApplyParallel pid=12345 mutator=fast_validate(readonly) mutator=validate:artifact_paths
         10:07:59 Debug: GET /api/2.0/workspace/get-status?path=/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files
         < HTTP/1.1 404 Not Found
         < {
        @@ -83,6 +81,8 @@
         >   "path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files"
         > }
         < HTTP/1.1 200 OK pid=12345 mutator=validate:files_to_sync sdk=true
        +10:07:59 Debug: ApplyParallel pid=12345 mutator=fast_validate(readonly) mutator=validate:job_task_cluster_spec
        +10:07:59 Debug: ApplyParallel pid=12345 mutator=fast_validate(readonly) mutator=validate:artifact_paths
         10:07:59 Debug: GET /api/2.0/workspace/get-status?path=/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files
         < HTTP/1.1 200 OK
         < {
```
denik added a commit that referenced this pull request Sep 11, 2025
Fix order issues in the output by sorting the output.

Previous attempt to fix this test did not work:
#3590

The flakiness started after rate limit was disabled in
#3581

For context, this test was originally sorting the output but that was
disabled in #2414 because it
seemed that output was stable. It was only stable because of delays
introduced by rate limiter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants