From fd5e673a2cdaf2d64ac0275ed0c97b6eb6a0a3e2 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 29 Feb 2024 09:42:17 -0500 Subject: [PATCH 1/6] add test id to test logger --- pkg/coordinator/test/test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/coordinator/test/test.go b/pkg/coordinator/test/test.go index ba45b17..d528553 100644 --- a/pkg/coordinator/test/test.go +++ b/pkg/coordinator/test/test.go @@ -27,7 +27,7 @@ type Test struct { func CreateTest(runID uint64, descriptor types.TestDescriptor, logger logrus.FieldLogger, services types.TaskServices, variables types.Variables) (types.Test, error) { test := &Test{ runID: runID, - logger: logger.WithField("RunID", runID), + logger: logger.WithField("RunID", runID).WithField("TestID", descriptor.ID()), descriptor: descriptor, config: descriptor.Config(), status: types.TestStatusPending, From 692e02b9bdf53346eff95b85b9983d39b731c343 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 29 Feb 2024 09:50:47 -0500 Subject: [PATCH 2/6] support testid for external tests --- pkg/coordinator/test/descriptor.go | 40 ++++++++++++++++++------------ 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/pkg/coordinator/test/descriptor.go b/pkg/coordinator/test/descriptor.go index 891dbad..387bf1e 100644 --- a/pkg/coordinator/test/descriptor.go +++ b/pkg/coordinator/test/descriptor.go @@ -10,6 +10,7 @@ import ( "time" "github.com/ethpandaops/assertoor/pkg/coordinator/types" + "github.com/sirupsen/logrus" "gopkg.in/yaml.v3" ) @@ -45,22 +46,29 @@ func LoadTestDescriptors(ctx context.Context, localTests []*types.TestConfig, ex testID := "" testConfig, err := loadExternalTestConfig(ctx, extTestCfg) - if err == nil { - if extTestCfg.Name != "" { - testConfig.Name = extTestCfg.Name - } - - if extTestCfg.Timeout != nil { - testConfig.Timeout = *extTestCfg.Timeout - } - - for k, v := range extTestCfg.Config { - testConfig.Config[k] = v - } - - for k, v := range extTestCfg.ConfigVars { - testConfig.ConfigVars[k] = v - } + if err != nil || testConfig == nil { + logrus.Errorf("error loading external test %v: %v", extTestCfg.File, err) + return nil + } + + if extTestCfg.Name != "" { + testConfig.Name = extTestCfg.Name + } + + if extTestCfg.Timeout != nil { + testConfig.Timeout = *extTestCfg.Timeout + } + + for k, v := range extTestCfg.Config { + testConfig.Config[k] = v + } + + for k, v := range extTestCfg.ConfigVars { + testConfig.ConfigVars[k] = v + } + + if testConfig.ID != "" { + testID = testConfig.ID } if testID == "" { From 03ab85eff714f1f4792b2a330c3b70117716d777 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 29 Feb 2024 10:09:40 -0500 Subject: [PATCH 3/6] add list of clients to fork logging --- pkg/coordinator/tasks/check_consensus_forks/task.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/coordinator/tasks/check_consensus_forks/task.go b/pkg/coordinator/tasks/check_consensus_forks/task.go index 9e4b7af..5217893 100644 --- a/pkg/coordinator/tasks/check_consensus_forks/task.go +++ b/pkg/coordinator/tasks/check_consensus_forks/task.go @@ -116,7 +116,11 @@ func (t *Task) runCheck() types.TaskResult { t.logger.Warnf("check failed: too many forks. (have: %v, want <= %v)", len(headForks)-1, t.config.MaxForkCount) for idx, fork := range headForks { - t.logger.Infof("Fork #%v: %v [0x%x] (%v clients)", idx, fork.Slot, fork.Root, len(fork.AllClients)) + clients := make([]string, len(fork.AllClients)) + for _, client := range fork.AllClients { + clients = append(clients, client.GetName()) + } + t.logger.Infof("Fork #%v: %v [0x%x] (%v clients: [%v])", idx, fork.Slot, fork.Root, len(fork.AllClients), clients) } return types.TaskResultFailure From 6efddca897b5f96d9b1dd6b3f1e7b1cb404d8718 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 29 Feb 2024 10:25:13 -0500 Subject: [PATCH 4/6] fix assertoor panic --- .../clients/consensus/rpc/eventstream/eventstream.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/coordinator/clients/consensus/rpc/eventstream/eventstream.go b/pkg/coordinator/clients/consensus/rpc/eventstream/eventstream.go index dc1a1c0..1fd2342 100644 --- a/pkg/coordinator/clients/consensus/rpc/eventstream/eventstream.go +++ b/pkg/coordinator/clients/consensus/rpc/eventstream/eventstream.go @@ -188,10 +188,9 @@ func (stream *Stream) receiveEvents(r io.ReadCloser) { return } - stream.closeMutex.Unlock() - pub, ok := ev.(StreamEvent) if !ok { + stream.closeMutex.Unlock() continue } @@ -204,6 +203,7 @@ func (stream *Stream) receiveEvents(r io.ReadCloser) { } stream.Events <- pub + stream.closeMutex.Unlock() } } From 1fb0e87afa70ac41d5d77e380c9257445d8c4798 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 29 Feb 2024 10:26:35 -0500 Subject: [PATCH 5/6] add api aport call log --- pkg/coordinator/test/test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/coordinator/test/test.go b/pkg/coordinator/test/test.go index d528553..e80a2a1 100644 --- a/pkg/coordinator/test/test.go +++ b/pkg/coordinator/test/test.go @@ -167,6 +167,7 @@ func (t *Test) Run(ctx context.Context) error { } func (t *Test) AbortTest(skipCleanup bool) { + t.logger.Info("aborting test") t.status = types.TestStatusAborted if t.taskScheduler != nil { From 0c5078f6eaf9a57cff39e9a2361b61a34b6fa615 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 29 Feb 2024 10:28:39 -0500 Subject: [PATCH 6/6] lint --- pkg/coordinator/tasks/check_consensus_forks/task.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/coordinator/tasks/check_consensus_forks/task.go b/pkg/coordinator/tasks/check_consensus_forks/task.go index 5217893..b21ba4d 100644 --- a/pkg/coordinator/tasks/check_consensus_forks/task.go +++ b/pkg/coordinator/tasks/check_consensus_forks/task.go @@ -120,6 +120,7 @@ func (t *Task) runCheck() types.TaskResult { for _, client := range fork.AllClients { clients = append(clients, client.GetName()) } + t.logger.Infof("Fork #%v: %v [0x%x] (%v clients: [%v])", idx, fork.Slot, fork.Root, len(fork.AllClients), clients) }