More Test coverage + fix some code coverage bugs (#321)

Connection to the CI databases is viewed by Postgres as coming from localhost. The pg_hba.conf file generated by the docker image uses trust for these connections, that's why we had no test coverage on SASL and md5 branches.

This PR fixes this issue. There was also an issue with under-reporting code coverage. This should be fixed now
This commit is contained in:
Mostafa Abdelraouf
2023-02-16 23:09:22 -06:00
committed by GitHub
parent 2a0483b6de
commit f9134807d7
10 changed files with 46 additions and 41 deletions

View File

@@ -221,7 +221,7 @@ describe "Admin" do
results = admin_conn.async_exec("SHOW POOLS")[0]
expect(results["maxwait"]).to eq("1")
expect(results["maxwait_us"].to_i).to be_within(100_000).of(500_000)
expect(results["maxwait_us"].to_i).to be_within(200_000).of(500_000)
sleep(4.5) # Allow time for stats to update
results = admin_conn.async_exec("SHOW POOLS")[0]

View File

@@ -46,7 +46,7 @@ describe "Random Load Balancing" do
end
end
expect(failed_count).to eq(2)
expect(failed_count).to be <= 2
processes.all_databases.each do |instance|
queries_routed = instance.count_select_1_plus_2
if processes.replicas[0..1].include?(instance)

View File

@@ -4,7 +4,7 @@ require 'pg'
require_relative 'helpers/pgcat_helper'
QUERY_COUNT = 300
MARGIN_OF_ERROR = 0.30
MARGIN_OF_ERROR = 0.35
def with_captured_stdout_stderr
sout = STDOUT.clone