speed up unit tests#5137
Merged
Merged
Conversation
Split migration specs into a dedicated parallel_rspec batch, cache runtime logs across runs, and tune the Postgres/MySQL CI services for non-durable test workloads. Trim hot-spot specs (RSA key reuse, smaller factories, fake clocks) and switch to targeted per-test truncation.
philippthun
reviewed
Jun 15, 2026
| require 'cloud_controller/uaa/uaa_token_decoder' | ||
|
|
||
| # Generate RSA-2048 keys once and reuse across examples; key randomness is irrelevant here. | ||
| RSA_TEST_KEYS = Array.new(4) { OpenSSL::PKey::RSA.new(2048) }.freeze |
Member
There was a problem hiding this comment.
This constant should either go into a more specific namespace (i.e. declaration inside the describe) or be set in a before(:all).
|
|
||
| # Sequel logger that records which tables an example wrote to, so we can truncate only those. | ||
| class WrittenTablesLogger | ||
| WRITE_REGEX = /\b(?:INSERT INTO|UPDATE|DELETE FROM|TRUNCATE TABLE|TRUNCATE)\s+[`"]?(\w+)/i |
Member
There was a problem hiding this comment.
This regex only works for non-qualified table names - which is what Sequel normally uses. If someone would issue an INSERT INTO <schema>.<table>, we would not clean this up correctly.
philippthun
approved these changes
Jun 15, 2026
ari-wg-gitbot
added a commit
to cloudfoundry/capi-release
that referenced
this pull request
Jun 15, 2026
Changes in cloud_controller_ng:
- speed up unit tests
PR: cloudfoundry/cloud_controller_ng#5137
Author: Johannes Haass <johannes.haass@sap.com>
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.
Split migration specs into a dedicated parallel_rspec batch, cache
runtime logs across runs, and tune the Postgres/MySQL CI services for
non-durable test workloads. Trim hot-spot specs (RSA key reuse, smaller
factories, fake clocks) and switch to targeted per-test truncation.
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests