@@ -530,8 +530,8 @@ export class NodeCommand extends BaseCommand {
530530 const podName = podNames [ nodeId ]
531531 subTasks . push ( {
532532 title : `Update node: ${ chalk . yellow ( nodeId ) } [ platformVersion = ${ releaseTag } ]` ,
533- task : ( ) =>
534- platformInstaller . fetchPlatform ( podName , releaseTag )
533+ task : async ( ) =>
534+ await platformInstaller . fetchPlatform ( podName , releaseTag )
535535 } )
536536 }
537537
@@ -834,12 +834,12 @@ export class NodeCommand extends BaseCommand {
834834 if ( self . configManager . getFlag ( flags . app ) !== '' && self . configManager . getFlag ( flags . app ) !== constants . HEDERA_APP_NAME ) {
835835 subTasks . push ( {
836836 title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
837- task : ( ) => self . checkNetworkNodeState ( nodeId , 100 , 'ACTIVE' , 'output/swirlds.log' )
837+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 100 , 'ACTIVE' , 'output/swirlds.log' )
838838 } )
839839 } else {
840840 subTasks . push ( {
841841 title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
842- task : ( ) => self . checkNetworkNodeState ( nodeId )
842+ task : async ( ) => await self . checkNetworkNodeState ( nodeId )
843843 } )
844844 }
845845 }
@@ -886,7 +886,7 @@ export class NodeCommand extends BaseCommand {
886886 const accountId = accountMap . get ( nodeId )
887887 subTasks . push ( {
888888 title : `Adding stake for node: ${ chalk . yellow ( nodeId ) } ` ,
889- task : ( ) => self . addStake ( ctx . config . namespace , accountId , nodeId )
889+ task : async ( ) => await self . addStake ( ctx . config . namespace , accountId , nodeId )
890890 } )
891891 }
892892
@@ -955,7 +955,7 @@ export class NodeCommand extends BaseCommand {
955955 const podName = ctx . config . podNames [ nodeId ]
956956 subTasks . push ( {
957957 title : `Stop node: ${ chalk . yellow ( nodeId ) } ` ,
958- task : ( ) => self . k8 . execContainer ( podName , constants . ROOT_CONTAINER , 'systemctl stop network-node' )
958+ task : async ( ) => await self . k8 . execContainer ( podName , constants . ROOT_CONTAINER , 'systemctl stop network-node' )
959959 } )
960960 }
961961
@@ -1235,12 +1235,12 @@ export class NodeCommand extends BaseCommand {
12351235 if ( config . app !== '' && config . app !== constants . HEDERA_APP_NAME ) {
12361236 subTasks . push ( {
12371237 title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
1238- task : ( ) => self . checkNetworkNodeState ( nodeId , 100 , 'ACTIVE' , 'output/swirlds.log' )
1238+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 100 , 'ACTIVE' , 'output/swirlds.log' )
12391239 } )
12401240 } else {
12411241 subTasks . push ( {
12421242 title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
1243- task : ( ) => self . checkNetworkNodeState ( nodeId )
1243+ task : async ( ) => await self . checkNetworkNodeState ( nodeId )
12441244 } )
12451245 }
12461246 }
@@ -1615,6 +1615,7 @@ export class NodeCommand extends BaseCommand {
16151615 title : 'Check existing nodes staked amount' ,
16161616 task : async ( ctx , task ) => {
16171617 const config = /** @type {NodeAddConfigClass } **/ ctx . config
1618+ self . logger . info ( 'sleep 60 seconds for the handler to be able to trigger the network node stake weight recalculate' )
16181619 await sleep ( 60000 )
16191620 const accountMap = getNodeAccountMap ( config . existingNodeIds )
16201621 for ( const nodeId of config . existingNodeIds ) {
@@ -1729,7 +1730,7 @@ export class NodeCommand extends BaseCommand {
17291730 for ( const nodeId of config . existingNodeIds ) {
17301731 subTasks . push ( {
17311732 title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
1732- task : ( ) => self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
1733+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
17331734 } )
17341735 }
17351736
@@ -1796,8 +1797,8 @@ export class NodeCommand extends BaseCommand {
17961797 for ( const nodeId of config . allNodeIds ) {
17971798 subTasks . push ( {
17981799 title : `Check Node: ${ chalk . yellow ( nodeId ) } ` ,
1799- task : ( ) =>
1800- self . k8 . waitForPods ( [ constants . POD_PHASE_RUNNING ] , [
1800+ task : async ( ) =>
1801+ await self . k8 . waitForPods ( [ constants . POD_PHASE_RUNNING ] , [
18011802 'fullstack.hedera.com/type=network-node' ,
18021803 `fullstack.hedera.com/node-name=${ nodeId } `
18031804 ] , 1 , 60 * 15 , 1000 ) // timeout 15 minutes
@@ -1896,12 +1897,12 @@ export class NodeCommand extends BaseCommand {
18961897 title : 'Check all nodes are ACTIVE' ,
18971898 task : async ( ctx , task ) => {
18981899 const subTasks = [ ]
1899- // sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string
1900+ self . logger . info ( ' sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string' )
19001901 await sleep ( 30000 )
19011902 for ( const nodeId of ctx . config . allNodeIds ) {
19021903 subTasks . push ( {
19031904 title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
1904- task : ( ) => self . checkNetworkNodeState ( nodeId , 200 )
1905+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 200 )
19051906 } )
19061907 }
19071908
@@ -1941,9 +1942,9 @@ export class NodeCommand extends BaseCommand {
19411942 } ,
19421943 {
19431944 title : 'Stake new node' ,
1944- task : ( ctx , _ ) => {
1945+ task : async ( ctx , _ ) => {
19451946 const config = /** @type {NodeAddConfigClass } **/ ctx . config
1946- self . addStake ( config . namespace , ctx . newNode . accountId , config . nodeId )
1947+ await self . addStake ( config . namespace , ctx . newNode . accountId , config . nodeId )
19471948 }
19481949 } ,
19491950 {
@@ -2606,7 +2607,7 @@ export class NodeCommand extends BaseCommand {
26062607 for ( const nodeId of config . existingNodeIds ) {
26072608 subTasks . push ( {
26082609 title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
2609- task : ( ) => self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
2610+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
26102611 } )
26112612 }
26122613
@@ -2669,6 +2670,9 @@ export class NodeCommand extends BaseCommand {
26692670 for ( const /** @type {NetworkNodeServices } **/ service of config . serviceMap . values ( ) ) {
26702671 await self . k8 . kubeClient . deleteNamespacedPod ( service . nodePodName , config . namespace , undefined , undefined , 1 )
26712672 }
2673+ self . logger . info ( 'sleep for 15 seconds to give time for pods to finish terminating' )
2674+ await sleep ( 15000 )
2675+
26722676 // again, the pod names will change after the pods are killed
26732677 config . serviceMap = await self . accountManager . getNodeServiceMap (
26742678 config . namespace )
@@ -2679,7 +2683,7 @@ export class NodeCommand extends BaseCommand {
26792683 }
26802684 } ,
26812685 {
2682- title : 'Check node pods are running ' ,
2686+ title : 'Check node pods are ready ' ,
26832687 task :
26842688 async ( ctx , task ) => {
26852689 const subTasks = [ ]
@@ -2689,11 +2693,11 @@ export class NodeCommand extends BaseCommand {
26892693 for ( const nodeId of config . allNodeIds ) {
26902694 subTasks . push ( {
26912695 title : `Check Node: ${ chalk . yellow ( nodeId ) } ` ,
2692- task : ( ) =>
2693- self . k8 . waitForPods ( [ constants . POD_PHASE_RUNNING ] , [
2694- 'fullstack.hedera.com/type=network-node' ,
2695- `fullstack.hedera.com/node-name=${ nodeId } `
2696- ] , 1 , 60 * 15 , 1000 ) // timeout 15 minutes
2696+ task : async ( ) =>
2697+ await self . k8 . waitForPodReady (
2698+ [ 'fullstack.hedera.com/type=network-node' ,
2699+ `fullstack.hedera.com/node-name=${ nodeId } ` ] ,
2700+ 1 , 300 , 2000 )
26972701 } )
26982702 }
26992703
@@ -2710,9 +2714,6 @@ export class NodeCommand extends BaseCommand {
27102714 title : 'Fetch platform software into network nodes' ,
27112715 task :
27122716 async ( ctx , task ) => {
2713- // without this sleep, copy software from local build to container sometimes fail
2714- await sleep ( 15000 )
2715-
27162717 const config = /** @type {NodeUpdateConfigClass } **/ ctx . config
27172718 return self . fetchLocalOrReleasedPlatformSoftware ( config . allNodeIds , config . podNames , config . releaseTag , task , config . localBuildPath )
27182719 }
@@ -2761,12 +2762,12 @@ export class NodeCommand extends BaseCommand {
27612762 title : 'Check all nodes are ACTIVE' ,
27622763 task : async ( ctx , task ) => {
27632764 const subTasks = [ ]
2764- // sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string
2765+ self . logger . info ( ' sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string' )
27652766 await sleep ( 30000 )
27662767 for ( const nodeId of ctx . config . allNodeIds ) {
27672768 subTasks . push ( {
27682769 title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
2769- task : ( ) => self . checkNetworkNodeState ( nodeId , 200 )
2770+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 200 )
27702771 } )
27712772 }
27722773
@@ -3098,7 +3099,7 @@ export class NodeCommand extends BaseCommand {
30983099 for ( const nodeId of config . existingNodeIds ) {
30993100 subTasks . push ( {
31003101 title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
3101- task : ( ) => self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
3102+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 100 , 'FREEZE_COMPLETE' )
31023103 } )
31033104 }
31043105
@@ -3157,6 +3158,7 @@ export class NodeCommand extends BaseCommand {
31573158 title : 'Check node pods are running' ,
31583159 task :
31593160 async ( ctx , task ) => {
3161+ self . logger . info ( 'sleep 20 seconds to give time for pods to come up after being killed' )
31603162 await sleep ( 20000 )
31613163 const subTasks = [ ]
31623164 const config = /** @type {NodeDeleteConfigClass } **/ ctx . config
@@ -3165,8 +3167,8 @@ export class NodeCommand extends BaseCommand {
31653167 for ( const nodeId of config . allNodeIds ) {
31663168 subTasks . push ( {
31673169 title : `Check Node: ${ chalk . yellow ( nodeId ) } ` ,
3168- task : ( ) =>
3169- self . k8 . waitForPods ( [ constants . POD_PHASE_RUNNING ] , [
3170+ task : async ( ) =>
3171+ await self . k8 . waitForPods ( [ constants . POD_PHASE_RUNNING ] , [
31703172 'fullstack.hedera.com/type=network-node' ,
31713173 `fullstack.hedera.com/node-name=${ nodeId } `
31723174 ] , 1 , 60 * 15 , 1000 ) // timeout 15 minutes
@@ -3238,12 +3240,12 @@ export class NodeCommand extends BaseCommand {
32383240 title : 'Check all nodes are ACTIVE' ,
32393241 task : async ( ctx , task ) => {
32403242 const subTasks = [ ]
3241- // sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string
3243+ self . logger . info ( ' sleep for 30 seconds to give time for the logs to roll over to prevent capturing an invalid "ACTIVE" string' )
32423244 await sleep ( 30000 )
32433245 for ( const nodeId of ctx . config . allNodeIds ) {
32443246 subTasks . push ( {
32453247 title : `Check node: ${ chalk . yellow ( nodeId ) } ` ,
3246- task : ( ) => self . checkNetworkNodeState ( nodeId , 200 )
3248+ task : async ( ) => await self . checkNetworkNodeState ( nodeId , 200 )
32473249 } )
32483250 }
32493251
@@ -3285,7 +3287,7 @@ export class NodeCommand extends BaseCommand {
32853287 title : 'Trigger stake weight calculate' ,
32863288 task : async ( ctx , task ) => {
32873289 const config = /** @type {NodeDeleteConfigClass } **/ ctx . config
3288- // sleep 60 seconds for the handler to be able to trigger the network node stake weight recalculate
3290+ self . logger . info ( ' sleep 60 seconds for the handler to be able to trigger the network node stake weight recalculate' )
32893291 await sleep ( 60000 )
32903292 const accountMap = getNodeAccountMap ( config . allNodeIds )
32913293 // send some write transactions to invoke the handler that will trigger the stake weight recalculate
0 commit comments