Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dhurley committed May 7, 2024
1 parent 943d841 commit 77e9ceb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ jobs:
version: "bookworm-slim"
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'
Expand Down
24 changes: 23 additions & 1 deletion test/performance/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,34 @@ func (h *handler) handle(server proto.Commander_CommandChannelServer, wg *sync.W
}()
h.handleCount.Inc()
for {
_, err := server.Recv()
commandReceived, err := server.Recv()
if err != nil {
fmt.Printf("Command Error: %v\n", err)
return
}
h.msgCount.Inc()

connectRequest := commandReceived.GetAgentConnectRequest()
if connectRequest != nil {
err = server.Send(
&proto.Command{
Data: &proto.Command_AgentConnectResponse{
AgentConnectResponse: &proto.AgentConnectResponse{
AgentConfig: &proto.AgentConfig{
Details: connectRequest.GetMeta().GetAgentDetails(),
},
Status: &proto.AgentConnectStatus{
StatusCode: proto.AgentConnectStatus_CONNECT_OK,
},
},
},
},
)
if err != nil {
fmt.Printf("Command Error: %v\n", err)
return
}
}
}
}

Expand Down

0 comments on commit 77e9ceb

Please sign in to comment.