diff --git a/cmd/root.go b/cmd/root.go index bd49ab29c517a2b51a7f2058f3dba526624f0a76..fc3218b7ae0581e8f07b9a7ae40986f8ecaa1ca7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,7 +15,6 @@ import ( "encoding/json" "errors" "fmt" - "gitlab.com/elixxir/client/storage/user" "io/fs" "io/ioutil" "log" @@ -26,6 +25,8 @@ import ( "sync" "time" + "gitlab.com/elixxir/client/storage/user" + "gitlab.com/elixxir/client/backup" "gitlab.com/elixxir/client/e2e" "gitlab.com/elixxir/client/xxdk" @@ -195,6 +196,8 @@ var rootCmd = &cobra.Command{ client := initClient() + jww.INFO.Printf("Client Initialized...") + user := client.GetUser() jww.INFO.Printf("USERPUBKEY: %s", user.E2eDhPublicKey.TextVerbose(16, 0)) @@ -219,14 +222,21 @@ var rootCmd = &cobra.Command{ recipientContact = user.GetContact() } + jww.INFO.Printf("Client: %s, Partner: %s", user.ReceptionID, + recipientID) + client.GetE2E().EnableUnsafeReception() recvCh := registerMessageListener(client) + jww.INFO.Printf("Starting Network followers...") + err := client.StartNetworkFollower(5 * time.Second) if err != nil { jww.FATAL.Panicf("%+v", err) } + jww.INFO.Printf("Network followers started!") + // Wait until connected or crash on timeout connected := make(chan bool, 10) client.GetCmix().AddHealthCallback( @@ -244,6 +254,8 @@ var rootCmd = &cobra.Command{ // 85% of the nodes numReg := 1 total := 100 + jww.INFO.Printf("Registering with nodes...") + for numReg < (total*3)/4 { time.Sleep(1 * time.Second) numReg, total, err = client.GetNodeRegistrationStatus() @@ -256,6 +268,8 @@ var rootCmd = &cobra.Command{ client.GetBackupContainer().TriggerBackup("Integration test.") + jww.INFO.Printf("Client backup triggered...") + // Send Messages msgBody := viper.GetString("message") time.Sleep(10 * time.Second) @@ -376,6 +390,8 @@ var rootCmd = &cobra.Command{ paramsE2E.ExcludedRounds = excludedRounds.NewSet() } + jww.INFO.Printf("Client Sending messages...") + wg := &sync.WaitGroup{} sendCnt := int(viper.GetUint("sendCount")) wg.Add(sendCnt) @@ -455,6 +471,8 @@ var rootCmd = &cobra.Command{ waitTimeout := time.Duration(waitSecs) * time.Second done := false + jww.INFO.Printf("Client receiving messages...") + for !done && expectedCnt != 0 { timeoutTimer := time.NewTimer(waitTimeout) select { @@ -511,7 +529,7 @@ var rootCmd = &cobra.Command{ if profileOut != "" { pprof.StopCPUProfile() } - + jww.INFO.Printf("Client exiting!") }, } diff --git a/e2e/critical.go b/e2e/critical.go index a605775419c8e2181e3d22eb3f984fed7a05bf3e..9a803886ff81faeded4e546a8462af9e78c73dc9 100644 --- a/e2e/critical.go +++ b/e2e/critical.go @@ -53,6 +53,7 @@ func newCritical(kv *versioned.KV, hm func(f func(bool)) uint64, E2eMessageBuffer: cm, trigger: make(chan bool, 100), send: send, + healthcb: hm, } return c diff --git a/e2e/manager.go b/e2e/manager.go index ceac6b8c95944ba7afe7e15c373f903b3336eff6..6d4102ebba81c19ee4ddce1bb7cf65ad8e3b7ecf 100644 --- a/e2e/manager.go +++ b/e2e/manager.go @@ -165,7 +165,7 @@ func (m *manager) StartProcesses() (stoppable.Stoppable, error) { critcalNetworkStopper := stoppable.NewSingle( "e2eCriticalMessagesStopper") - m.crit.runCriticalMessages(critcalNetworkStopper, + go m.crit.runCriticalMessages(critcalNetworkStopper, m.net.GetInstance().GetRoundEvents()) multi.Add(critcalNetworkStopper)