From f9ac4e5b80435cdbbe0b27e385cb96350d21177d Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Sat, 16 Sep 2023 21:51:48 +0200 Subject: [PATCH] Add test for ticker --- network/network_helpers_test.go | 4 +++- network/server_test.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/network/network_helpers_test.go b/network/network_helpers_test.go index 6cc09526..766c0315 100644 --- a/network/network_helpers_test.go +++ b/network/network_helpers_test.go @@ -112,7 +112,7 @@ func CollectAndComparePrometheusMetrics(t *testing.T) { gatewayd_bytes_sent_to_server_sum 282 gatewayd_bytes_sent_to_server_count 5 gatewayd_client_connections 1 - gatewayd_plugin_hooks_executed_total 10 + gatewayd_plugin_hooks_executed_total 11 gatewayd_plugin_hooks_registered_total 0 gatewayd_plugins_loaded_total 0 gatewayd_proxied_connections 1 @@ -122,6 +122,7 @@ func CollectAndComparePrometheusMetrics(t *testing.T) { gatewayd_server_connections 5 gatewayd_traffic_bytes_sum 182 gatewayd_traffic_bytes_count 4 + gatewayd_server_ticks_fired_total 1 ` metrics = []string{ @@ -139,6 +140,7 @@ func CollectAndComparePrometheusMetrics(t *testing.T) { "gatewayd_proxy_passthroughs_total", "gatewayd_server_connections", "gatewayd_traffic_bytes", + "gatewayd_server_ticks_fired_total", } ) assert.NoError(t, diff --git a/network/server_test.go b/network/server_test.go index 3c2f62b4..79da4e57 100644 --- a/network/server_test.go +++ b/network/server_test.go @@ -170,6 +170,7 @@ func TestRunServer(t *testing.T) { gnet.WithMulticore(false), gnet.WithReuseAddr(true), gnet.WithReusePort(true), + gnet.WithTicker(true), // Enable ticker. }, proxy, logger,