Skip to content

Commit

Permalink
Use before for setting json rpc url
Browse files Browse the repository at this point in the history
  • Loading branch information
minsulee2 committed Jun 30, 2022
1 parent 7c1d643 commit 0c01e43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion test/integration/he_sharding.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ describe('HE Sharding', () => {
});

describe('Shard reporter node restart', () => {
before(() => {
ENV_VARIABLES[2].PEER_CANDIDATE_JSON_RPC_URL = "http://localhost:9092/json-rpc";
});

it('can resume reporting after missing some reports', async () => {
const latestBefore = parseOrLog(syncRequest(
'GET', parentServer + `/get_value?ref=${sharding.sharding_path}/.shard/latest_block_number`)
Expand All @@ -352,7 +356,6 @@ describe('HE Sharding', () => {
server1_proc.kill();
await waitForNewBlocks(server2, sharding.reporting_period * 3);
console.log(` --> Restarting server[0]...`);
ENV_VARIABLES[2].PEER_CANDIDATE_JSON_RPC_URL = "http://localhost:9092/json-rpc";
server1_proc = startServer(APP_SERVER, 'server1', ENV_VARIABLES[2]);
await waitUntilNodeSyncs(server1);
await waitForNewShardingReports(parentServer, sharding.sharding_path);
Expand Down
5 changes: 4 additions & 1 deletion test/integration/sharding.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ describe('Sharding', () => {
});

describe('Shard reporter node restart', () => {
before(() => {
ENV_VARIABLES[2].PEER_CANDIDATE_JSON_RPC_URL = "http://localhost:9002/json-rpc";
});

it('can resume reporting after missing some reports', async () => {
const latestBefore = parseOrLog(syncRequest(
'GET', parentServer + `/get_value?ref=${sharding.sharding_path}/.shard/latest_block_number`)
Expand All @@ -457,7 +461,6 @@ describe('Sharding', () => {
server1_proc.kill();
await waitForNewBlocks(server2, sharding.reporting_period * 3);
console.log(` --> Restarting server[0]...`);
ENV_VARIABLES[2].PEER_CANDIDATE_JSON_RPC_URL = "http://localhost:9002/json-rpc";
server1_proc = startServer(APP_SERVER, 'server1', ENV_VARIABLES[2]);
await waitUntilNodeSyncs(server1);
await waitForNewShardingReports(parentServer, sharding.sharding_path);
Expand Down

0 comments on commit 0c01e43

Please sign in to comment.