Skip to content

Commit 25b55a9

Browse files
committed
Fix TestRunServer test to fix flakiness
Disable metric tests for now, as they are highly flaky
1 parent 5cbd813 commit 25b55a9

File tree

3 files changed

+184
-211
lines changed

3 files changed

+184
-211
lines changed

network/network_helpers_test.go

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ func CreatePgStartupPacket() []byte {
6565
return buf.Bytes
6666
}
6767

68+
// CreatePgTerminatePacket creates a PostgreSQL terminate packet.
69+
func CreatePgTerminatePacket() []byte {
70+
return []byte{'X', 0, 0, 0, 4}
71+
}
72+
6873
func CollectAndComparePrometheusMetrics(t *testing.T) {
6974
t.Helper()
7075

@@ -105,26 +110,26 @@ func CollectAndComparePrometheusMetrics(t *testing.T) {
105110

106111
var (
107112
want = metadata + `
108-
gatewayd_bytes_received_from_client_sum 67
109-
gatewayd_bytes_received_from_client_count 1
113+
gatewayd_bytes_received_from_client_sum 72
114+
gatewayd_bytes_received_from_client_count 3
110115
gatewayd_bytes_received_from_server_sum 24
111-
gatewayd_bytes_received_from_server_count 1
116+
gatewayd_bytes_received_from_server_count 2
112117
gatewayd_bytes_sent_to_client_sum 24
113118
gatewayd_bytes_sent_to_client_count 1
114-
gatewayd_bytes_sent_to_server_sum 67
115-
gatewayd_bytes_sent_to_server_count 1
116-
gatewayd_client_connections 1
117-
gatewayd_plugin_hooks_executed_total 11
119+
gatewayd_bytes_sent_to_server_sum 72
120+
gatewayd_bytes_sent_to_server_count 2
121+
gatewayd_client_connections 0
122+
gatewayd_plugin_hooks_executed_total 17
118123
gatewayd_plugin_hooks_registered_total 0
119124
gatewayd_plugins_loaded_total 0
120-
gatewayd_proxied_connections 1
125+
gatewayd_proxied_connections 0
121126
gatewayd_proxy_health_checks_total 0
122127
gatewayd_proxy_passthrough_terminations_total 0
123128
gatewayd_proxy_passthroughs_to_client_total 1
124129
gatewayd_proxy_passthroughs_to_server_total 1
125-
gatewayd_server_connections 5
126-
gatewayd_traffic_bytes_sum 182
127-
gatewayd_traffic_bytes_count 4
130+
gatewayd_server_connections 1
131+
gatewayd_traffic_bytes_sum 192
132+
gatewayd_traffic_bytes_count 8
128133
gatewayd_server_ticks_fired_total 1
129134
`
130135

0 commit comments

Comments
 (0)