You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make DBs run on ramdisk and optimize rspec parallelism
Since in a dev scenario we dont care about data loss we can speed up the
tests majorly by running the DBs on a ramdisk.
Also since the DB consumes CPU during the test its not good to start
rspec executes equal to the number of CPU cores since the sume of load
excedes that by a lot. So we leave 20% spare for the DB to have less
CPU preemtive scheduling and all in all finish the rspecs faster.
An environment variable was introduced PARALLEL_TEST_PROCESSORS_MULTIPLE
that can be set to any floating point value and multiplies the CPU core
count times PARALLEL_TEST_PROCESSORS_MULTIPLE. It defaults to 0.8 and
rounds the CPU count up to the next integer so it cannot be less than 1
ever.
mysql -h 127.0.0.1 -u root -psupersecret -e "CREATE DATABASE IF NOT EXISTS cc_test; CREATE DATABASE IF NOT EXISTS diego; CREATE DATABASE IF NOT EXISTS locket;"
@@ -54,9 +56,6 @@ POSTGRES_PID=$!
54
56
setupMariadb &
55
57
MARIADB_PID=$!
56
58
57
-
wait$POSTGRES_PID
58
-
wait$MARIADB_PID
59
-
60
59
# CC config
61
60
mkdir -p tmp
62
61
cp -a config/cloud_controller.yml tmp/cloud_controller.yml
@@ -120,4 +119,5 @@ yq -i e '.diego.bbs.ca_file="spec/fixtures/certs/bbs_ca.crt"' tmp/cloud_controll
120
119
121
120
yq -i e '.packages.max_package_size=2147483648' tmp/cloud_controller.yml
0 commit comments