Skip to content

Commit

Permalink
Merge pull request hyperledger#1135 from ArtObr/indy_1953
Browse files Browse the repository at this point in the history
INDY-1953: Fix for upgrade and test
  • Loading branch information
ashcherbakov authored Jan 21, 2019
2 parents 5af241c + 66865e5 commit 425d54c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion indy_node/server/upgrader.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def isScheduleValid(self, schedule, node_srvs, force) -> (bool, str):
return True, ''
times = sorted(times)
for i in range(len(times) - 1):
diff = (times[i + 1] - times[i]).seconds
diff = (times[i + 1] - times[i]).total_seconds()
if diff < self.config.MinSepBetweenNodeUpgrades:
return False, 'time span between upgrades is {} ' \
'seconds which is less than specified ' \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from copy import deepcopy

from datetime import datetime, timedelta

import dateutil
import dateutil.tz

from indy_node.test.upgrade.helper import sdk_ensure_upgrade_sent


def test_pool_upgrade_same_time_different_days(looper, tconf, nodeSet,
validUpgrade, sdk_pool_handle,
sdk_wallet_trustee, nodeIds):
day_in_sec = 24 * 60 * 60
upgr1 = deepcopy(validUpgrade)
schedule = {}
unow = datetime.utcnow().replace(tzinfo=dateutil.tz.tzutc())
startAt = unow + timedelta(seconds=day_in_sec)
for i in nodeIds:
schedule[i] = datetime.isoformat(startAt)
startAt = startAt + timedelta(seconds=day_in_sec)
upgr1['schedule'] = schedule

sdk_ensure_upgrade_sent(looper, sdk_pool_handle, sdk_wallet_trustee, upgr1)

0 comments on commit 425d54c

Please sign in to comment.