2
0

Disable SSL renegotiation

fixes #103
This commit is contained in:
Jack Christensen
2015-10-26 12:07:54 -05:00
parent 1e9206fc6c
commit 60cca3de7d
2 changed files with 50 additions and 0 deletions
+41
View File
@@ -84,6 +84,47 @@ func TestStressConnPool(t *testing.T) {
}
}
func TestStressTLSConnection(t *testing.T) {
t.Parallel()
if tlsConnConfig == nil {
t.Skip("Skipping due to undefined tlsConnConfig")
}
if testing.Short() {
t.Skip("Skipping due to testing -short")
}
conn, err := pgx.Connect(*tlsConnConfig)
if err != nil {
t.Fatalf("Unable to establish connection: %v", err)
}
defer conn.Close()
queryCount := 50
if testing.Short() {
queryCount /= 10
}
for i := 0; i < queryCount; i++ {
sql := `select * from generate_series(1, $1)`
rows, err := conn.Query(sql, 2000000)
if err != nil {
t.Fatal(err)
}
var n int32
for rows.Next() {
rows.Scan(&n)
}
if rows.Err() != nil {
t.Fatalf("queryCount: %d, Row number: %d. %v", i, n, rows.Err())
}
}
}
func setupStressDB(t *testing.T, pool *pgx.ConnPool) {
_, err := pool.Exec(`
drop table if exists widgets;