From 723c260e8b368b538a1627de8a8dbd99f571ee99 Mon Sep 17 00:00:00 2001 From: "Richard T. Carback III" <rick.carback@gmail.com> Date: Fri, 24 Jun 2022 01:49:55 +0000 Subject: [PATCH] Fix critical messages and add some debug logging in the CLI --- cmd/root.go | 22 ++++++++++++++++++++-- e2e/critical.go | 1 + e2e/manager.go | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index bd49ab29c..fc3218b7a 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 a60577541..9a803886f 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 ceac6b8c9..6d4102ebb 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) -- GitLab