Skip to content

[cr-test] test: share one database across the demand-matching cases - #1497

Closed
ac-pplx wants to merge 2 commits into
cr-test/1495-v5b-basefrom
cr-test/1495-v5b-head
Closed

ac-pplx wants to merge 2 commits into
cr-test/1495-v5b-basefrom
cr-test/1495-v5b-head

Conversation

@ac-pplx

@ac-pplx ac-pplx commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Summary

observed_demand_release_matching_characterization (cluster-pool) cloned a fresh test database for each of its ten cases. On CI it took 2.7 to 4.7 s: over the 2 s limit on every recent Rust tests run, and once over the 4 s failure bound from #1408. A run over that bound fails the Rust tests job of whichever pull request is running, whether or not it touches cluster-pool.

The cases now share one database. The releases and the policy are seeded once. Each case first deletes the template's sandboxes and every pool config, so it starts from the state a fresh database gave it. The cases and their expectations are unchanged.

Validation

At this head, on a dev box with Docker Postgres:

  • cargo fmt and cluster-pool clippy with all features and -D warnings pass. nextest passes all 75 cluster-pool tests.
  • This test, 20 runs each: before (main 95e0e7348), min 1.528 s, median 1.533 s, max 1.540 s; after, min 0.229 s, median 0.232 s, max 0.234 s. With the whole crate running in parallel, it took 0.16 s in each of 3 runs.
  • Sensitivity:
    • Changing the sha256:99… case's expected release fails the test on that case.
    • Dropping the sandbox delete fails it: demand from earlier cases accumulates.
    • Dropping the config delete does not fail it, because each autoscale step already retires the previous case's configs. The delete stays, so each case starts as on a fresh database rather than relying on that.

The CI timing at this head is in this PR's Rust tests job.

Severity and risk

Severity: low to medium. The test does not fail on its own merits, but an over-bound run fails unrelated pull requests at random.

Risk: test-only. A case could now see state an earlier case left. The deletes cover the rows the step reads, and the sensitivity checks above show the sandbox delete is what keeps cases apart. Roll back by reverting.

AI assistance: Claude Code drafted the change and this description, and ran the timing and sensitivity checks.

@ac-pplx

ac-pplx commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review --use-credits

@github-actions github-actions Bot added the triage:pending Waiting for a maintainer to triage label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! A SPACE maintainer will take a look.

CONTRIBUTING.md explains how we review outside contributions.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The characterization test now reuses one PostgreSQL fixture and resolver-release set, and upserts the policy once before the case loop. Before each case, it clears the fixture template’s sandboxes and all pool configs, then updates the template’s desired state. Demand insertion, autoscaling, and release assertions remain inside the loop.

Possibly related PRs

Merge Risk: Minimal · up to 3c96f

This test-only fixture optimization preserves case isolation and does not introduce production risk.

Architecture risk: Low · up to 3c96f

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/l30_storage/cluster/pool/src/tests.rs: The characterization test now creates the fixture and resolver releases once and upserts the policy before iterating. Each case clears that template’s sandboxes and all pool configs, then updates the template’s desired state; the former per-case fixture and release seeding, and per-case policy upsert, were removed.
Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title uses the bracketed lowercase area "cr-test" and a lowercase summary. It accurately describes sharing one database across the demand-matching test cases and has no trailing period, ticket ID,…
Description Follows The Pr Template Passed The description contains all required populated sections. "## Summary" explains the merge behavior, "## Validation" lists commands and results, "## Severity and risk" states severity and test-only ris…
Bug Fixes Name A Regression Test Passed PASS: The pull request changes only crates/l30_storage/cluster/pool/src/tests.rs. It reuses test fixtures and deletes test rows between cases. It does not fix application behavior, so the regression…
Weakened Safeguards Are Justified Passed PASS: The only changed file is the characterization test. The diff keeps all ten cases, demand insertion, autoscaling call, and expected-release assertion unchanged. It replaces per-case fixture creat…
Public-Safe Content Passed No public-safety violation is present. The diff changes only test setup in crates/l30_storage/cluster/pool/src/tests.rs; it contains no credentials, private URLs, workstation paths, resource identif…
Full details: Title check

Explanation

The title uses the bracketed lowercase area "cr-test" and a lowercase summary. It accurately describes sharing one database across the demand-matching test cases and has no trailing period, ticket ID, or internal link.

Full details: Description Follows The Pr Template

Explanation

The description contains all required populated sections. "## Summary" explains the merge behavior, "## Validation" lists commands and results, "## Severity and risk" states severity and test-only risk, and the line "AI assistance: Claude Code drafted the change and this description, and ran the timing and sensitivity checks." identifies the tool and its contributions.

Full details: Bug Fixes Name A Regression Test

Explanation

PASS: The pull request changes only crates/l30_storage/cluster/pool/src/tests.rs. It reuses test fixtures and deletes test rows between cases. It does not fix application behavior, so the regression-test requirement does not apply.

Full details: Weakened Safeguards Are Justified

Explanation

PASS: The only changed file is the characterization test. The diff keeps all ten cases, demand insertion, autoscaling call, and expected-release assertion unchanged. It replaces per-case fixture creation with explicit cleanup, and the PR description gives a specific performance reason for sharing the database; the adjacent comment documents the reset rationale. No test, assertion, lint, CI check, or repository guard is removed or weakened.

Full details: Public-Safe Content

Explanation

No public-safety violation is present. The diff changes only test setup in crates/l30_storage/cluster/pool/src/tests.rs; it contains no credentials, private URLs, workstation paths, resource identifiers, production data, or undisclosed security details. The title and description contain only generic test information and public-style issue references.

Recent review info

Automatic approval policy

Commit: 3c96fb9f8721.

Setting Effective value Source
Automatic approvals Enabled Global configuration
Merge risk Low Override 2
Security risk Not set Global configuration

Matching overrides (numbered as in the resolved configuration):

  • Override 2 — any author; paths: **, !ui/**; merge risk: Low.

Any matching disabled override withholds approval, regardless of risk. Otherwise, the strictest explicitly set limit wins for each score. Limits omitted by all matching overrides inherit the global configuration.

Not set means no limit was configured after inheritance. Use @coderabbitai configuration to inspect the resolved settings and their sources.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2f46733 and 3c96fb9.

Files selected for processing: 1

  • crates/l30_storage/cluster/pool/src/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 0 remain after this review.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Action performed

Full review finished.

@ac-pplx

ac-pplx commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Closing: CodeRabbit configuration test finished; the tested configuration is in #1496.

@ac-pplx ac-pplx closed this Nov 5, 2026
@ac-pplx
ac-pplx deleted the cr-test/1495-v5b-head branch November 5, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage:pending Waiting for a maintainer to triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant