diff --git a/config/config.go b/config/config.go index b17bd36742..9784ab08ab 100644 --- a/config/config.go +++ b/config/config.go @@ -504,7 +504,7 @@ func initConsensusTestProtocols() { Consensus[protocol.ConsensusTestBigBlocks] = testBigBlocks rapidRecalcParams := Consensus[protocol.ConsensusCurrentVersion] - rapidRecalcParams.RewardsRateRefreshInterval = 25 + rapidRecalcParams.RewardsRateRefreshInterval = 10 //because rapidRecalcParams is based on ConsensusCurrentVersion, //it *shouldn't* have any ApprovedUpgrades //but explicitly mark "no approved upgrades" just in case diff --git a/test/e2e-go/features/participation/participationRewards_test.go b/test/e2e-go/features/participation/participationRewards_test.go index 43da3e9f1d..956a3a58ff 100644 --- a/test/e2e-go/features/participation/participationRewards_test.go +++ b/test/e2e-go/features/participation/participationRewards_test.go @@ -19,9 +19,9 @@ package participation import ( "fmt" "path/filepath" - "testing" "runtime" - + "testing" + "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/config" @@ -88,7 +88,7 @@ func TestOnlineOfflineRewards(t *testing.T) { offlineClient := fixture.GetLibGoalClientForNamedNode("Offline") // learn initial balances - initialRound := uint64(301) + initialRound := uint64(11) r.NoError(fixture.WaitForRoundWithTimeout(initialRound)) initialOnlineBalance, _ := onlineClient.GetBalance(onlineAccount) initialOfflineBalance, _ := offlineClient.GetBalance(offlineAccount) diff --git a/test/scripts/e2e_client_runner.py b/test/scripts/e2e_client_runner.py index e092f1935d..72da5ba8c8 100644 --- a/test/scripts/e2e_client_runner.py +++ b/test/scripts/e2e_client_runner.py @@ -264,12 +264,39 @@ def wait(self, timeout): self.ok = False self._terminate() -def goal_network_stop(netdir): + +# 'network stop' and 'network delete' are also tested and used as cleanup procedures +# so it re-raises exception in 'test' mode +already_stopped = False +already_deleted = False + +def goal_network_stop(netdir, normal_cleanup=False): + global already_stopped, already_deleted + if already_stopped or already_deleted: + return + logger.info('stop network in %s', netdir) try: xrun(['goal', 'network', 'stop', '-r', netdir], timeout=10) except Exception as e: logger.error('error stopping network', exc_info=True) + if normal_cleanup: + raise e + already_stopped = True + +def goal_network_delete(netdir, normal_cleanup=False): + global already_deleted + if already_deleted: + return + + logger.info('delete network in %s', netdir) + try: + xrun(['goal', 'network', 'delete', '-r', netdir], timeout=10) + except Exception as e: + logger.error('error deleting network', exc_info=True) + if normal_cleanup: + raise e + already_deleted = True def xrun(cmd, *args, **kwargs): timeout = kwargs.pop('timeout', None) @@ -371,6 +398,12 @@ def main(): else: logger.info('finished OK %f seconds', time.time() - start) logger.info('statuses-json: %s', json.dumps(rs.statuses)) + + # ensure 'network stop' and 'network delete' also make they job + goal_network_stop(netdir, normal_cleanup=True) + if not args.keep_temps: + goal_network_delete(netdir, normal_cleanup=True) + return retcode if __name__ == '__main__': diff --git a/test/scripts/run_integration_tests.sh b/test/scripts/run_integration_tests.sh index c2f0af31ab..6eb04ee140 100755 --- a/test/scripts/run_integration_tests.sh +++ b/test/scripts/run_integration_tests.sh @@ -12,10 +12,6 @@ export ALGOTEST=1 #./test/scripts/test_running_install_and_update.sh -c "${CHANNEL}" #./test/scripts/test_update_rollback.sh -c "${CHANNEL}" -# Test deploying, running, and deleting a local private network -# TODO: delete this, it is redundant with tests that come after -./test/scripts/test_private_network.sh - # Run suite of e2e tests against a single installation of the current build ./test/scripts/e2e.sh