Skip to content

Commit 8ff8609

Browse files
committed
Replace t.Context in multi-access scenarios
1 parent 402bd5b commit 8ff8609

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

integration-tests/init.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var chains Chains
1919

2020
// flag variables.
2121
var (
22+
ctx context.Context
2223
coreumCfg CoreumChainConfig
2324
xrplCfg XRPLChainConfig
2425
bridgeCfg BridgeConfig
@@ -43,6 +44,8 @@ func init() {
4344
flag.StringVar(&bridgeCfg.ContractAddress, "contract-address", "devcore14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sd4f0ak", "Smart contract address of the bridge (znet)")
4445
flag.StringVar(&bridgeCfg.OwnerMnemonic, "owner-mnemonic", "analyst evil lucky job exhaust inform note where grant file already exit vibrant come finger spatial absorb enter aisle orange soldier false attend response", "Smart contract owner of the bridge (znet)")
4546

47+
ctx = context.Background()
48+
4649
// accept testing flags
4750
testing.Init()
4851
// parse additional flags
@@ -73,7 +76,7 @@ func init() {
7376

7477
// NewTestingContext returns the configured coreum and xrpl chains and new context for the integration tests.
7578
func NewTestingContext(t *testing.T) (context.Context, Chains) {
76-
testCtx, testCtxCancel := context.WithTimeout(t.Context(), 30*time.Minute)
79+
testCtx, testCtxCancel := context.WithTimeout(ctx, 30*time.Minute)
7780
t.Cleanup(func() {
7881
require.NoError(t, testCtx.Err())
7982
testCtxCancel()

relayer/processes/xrpl_to_coreum_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ func TestXRPLToCoreumProcess_Start(t *testing.T) {
2323
recipientXRPLAddress := xrpl.GenPrivKeyTxSigner().Account()
2424
issuerAccount := xrpl.GenPrivKeyTxSigner().Account()
2525

26+
ctx := context.Background()
27+
2628
// tecPATH_PARTIAL
2729
failTxResult := rippledata.TransactionResult(101)
2830
// tefBAD_AUTH
@@ -713,7 +715,7 @@ func TestXRPLToCoreumProcess_Start(t *testing.T) {
713715
t.Run(tt.name, func(t *testing.T) {
714716
t.Parallel()
715717

716-
ctx, cancel := context.WithCancel(t.Context())
718+
ctx, cancel := context.WithCancel(ctx)
717719
t.Cleanup(cancel)
718720

719721
ctrl := gomock.NewController(t)

0 commit comments

Comments
 (0)