|
4 | 4 | "bytes" |
5 | 5 | "errors" |
6 | 6 | "fmt" |
7 | | - "io/ioutil" |
| 7 | + "io" |
8 | 8 | "math" |
9 | 9 | "net/http" |
10 | 10 | "reflect" |
@@ -122,7 +122,7 @@ func TestGetClusterMembers(t *testing.T) { |
122 | 122 | {"name": "acid-test-cluster-2", "role": "replica", "state": "running", "api_url": "http://192.168.100.3:8008/patroni", "host": "192.168.100.3", "port": 5432, "timeline": 1, "lag": "unknown"}, |
123 | 123 | {"name": "acid-test-cluster-3", "role": "replica", "state": "running", "api_url": "http://192.168.100.3:8008/patroni", "host": "192.168.100.3", "port": 5432, "timeline": 1, "lag": 3000000000} |
124 | 124 | ]}` |
125 | | - r := ioutil.NopCloser(bytes.NewReader([]byte(json))) |
| 125 | + r := io.NopCloser(bytes.NewReader([]byte(json))) |
126 | 126 |
|
127 | 127 | response := http.Response{ |
128 | 128 | StatusCode: 200, |
@@ -161,7 +161,7 @@ func TestGetMemberData(t *testing.T) { |
161 | 161 | } |
162 | 162 |
|
163 | 163 | json := `{"state": "running", "postmaster_start_time": "2021-02-19 14:31:50.053 CET", "role": "master", "server_version": 130004, "cluster_unlocked": false, "xlog": {"location": 123456789}, "timeline": 1, "database_system_identifier": "6462555844314089962", "pending_restart": true, "patroni": {"version": "2.1.1", "scope": "acid-test-cluster"}}` |
164 | | - r := ioutil.NopCloser(bytes.NewReader([]byte(json))) |
| 164 | + r := io.NopCloser(bytes.NewReader([]byte(json))) |
165 | 165 |
|
166 | 166 | response := http.Response{ |
167 | 167 | StatusCode: 200, |
@@ -230,7 +230,7 @@ func TestGetConfig(t *testing.T) { |
230 | 230 | } |
231 | 231 |
|
232 | 232 | configJson := `{"loop_wait": 10, "maximum_lag_on_failover": 33554432, "postgresql": {"parameters": {"archive_mode": "on", "archive_timeout": "1800s", "autovacuum_analyze_scale_factor": 0.02, "autovacuum_max_workers": 5, "autovacuum_vacuum_scale_factor": 0.05, "checkpoint_completion_target": 0.9, "hot_standby": "on", "log_autovacuum_min_duration": 0, "log_checkpoints": "on", "log_connections": "on", "log_disconnections": "on", "log_line_prefix": "%t [%p]: [%l-1] %c %x %d %u %a %h ", "log_lock_waits": "on", "log_min_duration_statement": 500, "log_statement": "ddl", "log_temp_files": 0, "max_connections": 100, "max_replication_slots": 10, "max_wal_senders": 10, "tcp_keepalives_idle": 900, "tcp_keepalives_interval": 100, "track_functions": "all", "wal_level": "hot_standby", "wal_log_hints": "on"}, "use_pg_rewind": true, "use_slots": true}, "retry_timeout": 10, "slots": {"cdc": {"database": "foo", "plugin": "pgoutput", "type": "logical"}}, "ttl": 30}` |
233 | | - r := ioutil.NopCloser(bytes.NewReader([]byte(configJson))) |
| 233 | + r := io.NopCloser(bytes.NewReader([]byte(configJson))) |
234 | 234 |
|
235 | 235 | response := http.Response{ |
236 | 236 | StatusCode: 200, |
@@ -265,7 +265,7 @@ func TestSetPostgresParameters(t *testing.T) { |
265 | 265 | } |
266 | 266 |
|
267 | 267 | configJson := `{"loop_wait": 10, "maximum_lag_on_failover": 33554432, "postgresql": {"parameters": {"archive_mode": "on", "archive_timeout": "1800s", "autovacuum_analyze_scale_factor": 0.02, "autovacuum_max_workers": 5, "autovacuum_vacuum_scale_factor": 0.05, "checkpoint_completion_target": 0.9, "hot_standby": "on", "log_autovacuum_min_duration": 0, "log_checkpoints": "on", "log_connections": "on", "log_disconnections": "on", "log_line_prefix": "%t [%p]: [%l-1] %c %x %d %u %a %h ", "log_lock_waits": "on", "log_min_duration_statement": 500, "log_statement": "ddl", "log_temp_files": 0, "max_connections": 50, "max_replication_slots": 10, "max_wal_senders": 10, "tcp_keepalives_idle": 900, "tcp_keepalives_interval": 100, "track_functions": "all", "wal_level": "logical", "wal_log_hints": "on"}, "use_pg_rewind": true, "use_slots": true}, "retry_timeout": 10, "slots": {"cdc": {"database": "foo", "plugin": "pgoutput", "type": "logical"}}, "ttl": 30}` |
268 | | - r := ioutil.NopCloser(bytes.NewReader([]byte(configJson))) |
| 268 | + r := io.NopCloser(bytes.NewReader([]byte(configJson))) |
269 | 269 |
|
270 | 270 | response := http.Response{ |
271 | 271 | StatusCode: 200, |
|
0 commit comments