Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package participation
import (
"fmt"
"path/filepath"
"testing"
"runtime"

"testing"

"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/config"
Expand Down Expand Up @@ -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)
Expand Down
35 changes: 34 additions & 1 deletion test/scripts/e2e_client_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add atexit registration of this after goal network create ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not needed because there is a generic cleaner with rmtree.
already_deleted flag is still needed to prevent running goal_network_stop from atexit handler.

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)
Expand Down Expand Up @@ -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__':
Expand Down
4 changes: 0 additions & 4 deletions test/scripts/run_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down