Skip to content

test(controlplane): turn off postgres durability in the test container - #3646

Merged
migmartri merged 1 commit into
mainfrom
test-db-durability-off
Oct 18, 2026
Merged

migmartri merged 1 commit into
mainfrom
test-db-durability-off

Conversation

@migmartri

@migmartri migmartri commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Start the control plane integration test PostgreSQL container with durability off. The test database is thrown away after each run, so it does not need writes to reach the disk.

NewTestDatabase now starts postgres:16-alpine with fsync=off, synchronous_commit=off and full_page_writes=off, and keeps the data directory on tmpfs. These settings apply only to the disposable test container.

Run times

Command: go test -count=1 -timeout 30m $(go list ./... | grep -v /pkg/data/ent) in app/controlplane (the make test package list, uncached, with a longer timeout so pkg/biz can finish).
Machine: Intel i7-7700K (8 threads), 32 GB RAM, Fedora 43, Docker. Other jobs shared the machine (load average 2-9), so read the numbers as approximate.

Run Wall time pkg/biz Result
Before, run 1 (default 10m timeout) 633s+ timed out at 600s failed
Before, run 2 767s 753s failed: container startup timeouts
After, run 1 408s 387s all 33 packages pass
After, run 2 415s 403s all 33 packages pass

The suite is about 45% faster. Before the change, several suites failed under load because the container did not get ready within the 5s startup wait. After the change, no container startup timed out in either run.

Closes #3645

This change was made with AI assistance (Claude Code).

🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri using the eng-autopilot skill

View guided diff

The integration test database is disposable, so start it with fsync,
synchronous_commit and full_page_writes off and keep its data directory
on tmpfs. This makes the control plane test suite run faster.

Closes #3645

Assisted-by: Claude Code
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>

Chainloop-Trace-Sessions: 3a3863d9-a0d3-432b-9ce7-eb6c74404598
@migmartri
migmartri requested a review from a team October 17, 2026 22:51
@chainloop-platform

chainloop-platform Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

PR validation — ✅ 3 passing

Status Policy Material Messages
✅ Passed pr-min-approvals pr-info -
✅ Passed pr-description-required pr-info -
✅ Passed pr-user-story-linked pr-info -

View attestation ↗

AI Session Checks — 🟢 88% · ✅ 0 failing

Avg score Sessions Failing policies Attribution Files Lines Total Duration
🟢 88% 1 ✅ 0 100% AI / 0% Human 1 +9 / -0 39m54s

🟢 88% — 100% AI — ✅ All policies passing

Oct 17, 2026 22:10 UTC · 39m54s · $4.17 · 176 in / 28.9k out · claude-code 2.1.302 (claude-opus-5-5)

View session details ↗

Change Summary

  • Adds PostgreSQL durability-off flags in NewTestDatabase for control-plane integration tests.
  • Keeps the disposable test database on tmpfs.
  • Runs baseline and post-change control-plane suites, then commits the one-file change.

AI Session Overall Score

🟢 88% — Autonomous run, well-scoped and strongly exercised, but without direct human reaction signal.

AI Session Analysis Breakdown

🟢 97% · scope-discipline

🟢 The committed change stayed to the named helper and matched the stated behavior. · High Impact

🟢 95% · alignment

No notes.

🟢 94% · context-and-planning

🟢 The opening task fully specified scope, constraints, testing, and repo workflow. · High Impact

🟢 88% · solution-quality

No notes.

🟡 76% · verification

🟢 The AI reran the full control-plane suite twice after the edit and recorded timings. · High Impact

🟠 The shared helper changed without a targeted test, so confidence rests on broad integration runs. · Medium Severity

💡 Add one focused assertion for new container startup settings when shared test infrastructure changes.

abstained · user-trust-signal

🟡 No meaningful user reaction followed the autonomous run, so trust was not directly observed. · Low Severity


File Attribution

████████████████████ 100% AI / 0% Human

Status Attribution File Lines
modified ai app/controlplane/pkg/biz/testhelpers/database.go +9 / -0

Policies (5)

Status Policy Material Messages
✅ Passed ai-session-no-auto-pr ai-coding-session-3a3863 -
✅ Passed ai-config-ai-agents-allowed ai-coding-session-3a3863 -
✅ Passed ai-config-no-dangerous-commands ai-coding-session-3a3863 -
✅ Passed ai-config-no-secrets ai-coding-session-3a3863 -
✅ Passed ai-config-mcp-servers-allowed ai-coding-session-3a3863 -

Security Checks — ✅ 5 passing

✅ secret-scan

Status Policy Messages
✅ Passed secrets-detection -

✅ sast-scan

Status Policy Messages
✅ Passed cwe-top26-40-cusp -
✅ Passed owasp-top10-2025 -
✅ Passed sast -
✅ Passed cwe-top25 -
Scans not applied (3)
Scan Reason
vulnerability-scan no manifest/lockfile changed
github-actions-scan no workflow files changed
iac-scan no IaC files changed

View attestation ↗

Security context

✅ Nothing this change touches has a recorded security-fix history.

View in Chainloop ↗ · How this works ↗


Powered by Chainloop and Chainloop Trace

@migmartri
migmartri marked this pull request as ready for review October 18, 2026 09:18

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

@migmartri
migmartri merged commit 241a5c8 into main Oct 18, 2026
17 checks passed
@migmartri
migmartri deleted the test-db-durability-off branch October 18, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Speed up control plane integration tests: turn off PostgreSQL durability in the test container

2 participants