From f072caf7257df4ce5559efda38ac2561529ca3ff Mon Sep 17 00:00:00 2001 From: TeoV Date: Fri, 22 Nov 2019 11:28:16 +0200 Subject: [PATCH] Add a small delay between account operations and get account --- apier/v1/dm_remote_it_test.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/apier/v1/dm_remote_it_test.go b/apier/v1/dm_remote_it_test.go index 70763f01e..6eac1fc95 100644 --- a/apier/v1/dm_remote_it_test.go +++ b/apier/v1/dm_remote_it_test.go @@ -679,6 +679,11 @@ func testInternalReplicationSetThreshold(t *testing.T) { } else if !reflect.DeepEqual(tPrfl.ThresholdProfile, reply) { t.Errorf("Expecting: %+v, received: %+v", tPrfl.ThresholdProfile, reply) } + expectedIDX2 := []string{ + "*string:~Account:1001:THD_ACNT_1001", + "*string:~Account:1001:THD_Replication", + "*string:~CustomField:CustomValue:THD_Replication", + } // verify indexes on engine1 (should be the same as internal) if err := engineOneRPC.Call("ApierV1.GetFilterIndexes", &AttrGetFilterIndexes{ ItemType: utils.MetaThresholds, Tenant: "cgrates.org", FilterType: utils.MetaString}, @@ -686,9 +691,9 @@ func testInternalReplicationSetThreshold(t *testing.T) { t.Error(err) } sort.Strings(indexes) - if !reflect.DeepEqual(expectedIDX, indexes) { + if !reflect.DeepEqual(expectedIDX2, indexes) { t.Errorf("Expecting: %+v, received: %+v", - expectedIDX, utils.ToJSON(indexes)) + expectedIDX2, utils.ToJSON(indexes)) } // verify data on engine2 if err := engineTwoRPC.Call("ApierV1.GetThresholdProfile", @@ -775,7 +780,7 @@ func testInternalAccountBalanceOperations(t *testing.T) { if err := internalRPC.Call(utils.ApierV1SetBalance, attrs, &reply); err != nil { t.Error(err) } - + time.Sleep(50 * time.Millisecond) var acnt *engine.Account attrAcc := &utils.AttrGetAccount{ Tenant: "cgrates.org", @@ -814,7 +819,7 @@ func testInternalAccountBalanceOperations(t *testing.T) { } else if reply != utils.OK { t.Errorf("Received: %s", reply) } - + time.Sleep(50 * time.Millisecond) // verify debited account on engineOne if err := engineOneRPC.Call(utils.ApierV2GetAccount, attrAcc, &acnt); err != nil { t.Error(err) @@ -847,7 +852,7 @@ func testInternalAccountBalanceOperations(t *testing.T) { if err := internalRPC.Call(utils.ApierV1AddBalance, addBal, &reply); err != nil { t.Error(err) } - + time.Sleep(50 * time.Millisecond) // verify account on engineOne if err := engineOneRPC.Call(utils.ApierV2GetAccount, attrAcc, &acnt); err != nil { t.Error(err)