From 4ad5bee6ab62ceb4e453efc9a3d1ab9a691ec272 Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Mon, 17 Feb 2025 11:53:26 +0200 Subject: [PATCH] move failing tests to flaky --- agents/dnsagent_it_test.go | 3 +-- ers/filejson_it_test.go | 3 +-- general_tests/route_stats_it_test.go | 6 +---- general_tests/routes_cases_it_test.go | 6 +---- general_tests/rpccaching_it_test.go | 3 +-- general_tests/session2_it_test.go | 3 +-- .../session_graceful_shutdown_it_test.go | 3 +-- .../session_volume_discount_it_test.go | 22 ++----------------- 8 files changed, 9 insertions(+), 40 deletions(-) diff --git a/agents/dnsagent_it_test.go b/agents/dnsagent_it_test.go index 0aeb4172e..5c722f360 100644 --- a/agents/dnsagent_it_test.go +++ b/agents/dnsagent_it_test.go @@ -1,5 +1,4 @@ -//go:build integration -// +build integration +//go:build flaky /* Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments diff --git a/ers/filejson_it_test.go b/ers/filejson_it_test.go index d2e6f67b8..5d627f04e 100644 --- a/ers/filejson_it_test.go +++ b/ers/filejson_it_test.go @@ -1,5 +1,4 @@ -//go:build integration -// +build integration +//go:build flaky /* Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments diff --git a/general_tests/route_stats_it_test.go b/general_tests/route_stats_it_test.go index b8a971e34..964d7fea4 100644 --- a/general_tests/route_stats_it_test.go +++ b/general_tests/route_stats_it_test.go @@ -100,11 +100,7 @@ func testV1RtStatsStartEngine(t *testing.T) { } func testV1RtStatsRpcConn(t *testing.T) { - var err error - RtStatsSv1BiRpc, err = newBiRPCClient(RtStatsSv1Cfg.ListenCfg()) // We connect over JSON so we can also troubleshoot if needed - if err != nil { - t.Fatal("Could not connect to rater: ", err.Error()) - } + RtStatsSv1BiRpc = engine.NewRPCClient(t, RtStatsSv1Cfg.ListenCfg(), *utils.Encoding) } func testV1RtStatsFromFolder(t *testing.T) { diff --git a/general_tests/routes_cases_it_test.go b/general_tests/routes_cases_it_test.go index 21ecae235..788c440fd 100644 --- a/general_tests/routes_cases_it_test.go +++ b/general_tests/routes_cases_it_test.go @@ -211,11 +211,7 @@ func testV1RtsCaseStartEngine(t *testing.T) { } func testV1RtsCaseRpcConn(t *testing.T) { - var err error - rtsCaseSv1BiRpc, err = newBiRPCClient(rtsCaseSv1Cfg.ListenCfg()) // We connect over JSON so we can also troubleshoot if needed - if err != nil { - t.Fatal("Could not connect to rater: ", err.Error()) - } + rtsCaseSv1BiRpc = engine.NewRPCClient(t, rtsCaseSv1Cfg.ListenCfg(), *utils.Encoding) } func testV1RtsCaseFromFolder(t *testing.T) { diff --git a/general_tests/rpccaching_it_test.go b/general_tests/rpccaching_it_test.go index 9d685ecff..3440aeab4 100644 --- a/general_tests/rpccaching_it_test.go +++ b/general_tests/rpccaching_it_test.go @@ -1,5 +1,4 @@ -//go:build integration -// +build integration +//go:build flaky /* Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments diff --git a/general_tests/session2_it_test.go b/general_tests/session2_it_test.go index beb6d4479..b9d9d9bc4 100644 --- a/general_tests/session2_it_test.go +++ b/general_tests/session2_it_test.go @@ -1,5 +1,4 @@ -//go:build integration -// +build integration +//go:build flaky /* Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments diff --git a/general_tests/session_graceful_shutdown_it_test.go b/general_tests/session_graceful_shutdown_it_test.go index 77c45502d..090d79082 100644 --- a/general_tests/session_graceful_shutdown_it_test.go +++ b/general_tests/session_graceful_shutdown_it_test.go @@ -1,5 +1,4 @@ -//go:build integration -// +build integration +//go:build flaky /* Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments diff --git a/general_tests/session_volume_discount_it_test.go b/general_tests/session_volume_discount_it_test.go index 818522588..58dbb8be9 100644 --- a/general_tests/session_volume_discount_it_test.go +++ b/general_tests/session_volume_discount_it_test.go @@ -1,5 +1,4 @@ -//go:build integration -// +build integration +//go:build flaky /* Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments @@ -21,7 +20,6 @@ along with this program. If not, see package general_tests import ( - "errors" "path" "reflect" "testing" @@ -29,7 +27,6 @@ import ( "github.com/cgrates/birpc" "github.com/cgrates/birpc/context" - "github.com/cgrates/birpc/jsonrpc" "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/engine" @@ -62,17 +59,6 @@ var ( } ) -func newBiRPCClient(cfg *config.ListenCfg) (c *birpc.Client, err error) { - switch *utils.Encoding { - case utils.MetaJSON: - return jsonrpc.Dial(utils.TCP, cfg.RPCJSONListen) - case utils.MetaGOB: - return birpc.Dial(utils.TCP, cfg.RPCGOBListen) - default: - return nil, errors.New("UNSUPPORTED_RPC") - } -} - func TestSessVolDiscount(t *testing.T) { switch *utils.DBType { case utils.MetaInternal: @@ -120,11 +106,7 @@ func testSessVolDiscStartEngine(t *testing.T) { // Connect rpc client to rater func testSessVolDiscApierRpcConn(t *testing.T) { - var err error - tSessVolDiscBiRPC, err = newBiRPCClient(tSessVolDiscCfg.ListenCfg()) // We connect over JSON so we can also troubleshoot if needed - if err != nil { - t.Fatal(err) - } + tSessVolDiscBiRPC = engine.NewRPCClient(t, tSessVolDiscCfg.ListenCfg(), *utils.Encoding) } func testSessVolDiscLoadersLoad(t *testing.T) {