Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package integration

import (
"context"
"encoding/json"
"fmt"
"os"
"testing"
Expand Down Expand Up @@ -145,6 +146,27 @@ func TestIntegration_5Agents(t *testing.T) {
if string(val) != "exit" {
t.Errorf("Agent %d: expected 'exit' for /app/state, got '%s' (type %s)", i, string(val), valType)
}

// Verify that all 5 agents are mentioned in /_internal/peers
peerVal, _, _, _, getErr := agents[i].store.GetKVEntry("/_internal/peers")
if getErr != nil {
t.Errorf("Agent %d: failed to get KV entry for /_internal/peers: %v", i, getErr)
continue
}
var peers map[string]state.PeerInfo
if err := json.Unmarshal(peerVal, &peers); err != nil {
t.Errorf("Agent %d: failed to unmarshal peers: %v", i, err)
continue
}
if len(peers) != numAgents {
t.Errorf("Agent %d: expected %d peers, got %d", i, numAgents, len(peers))
}
for j := 0; j < numAgents; j++ {
expectedID := fmt.Sprintf("agent-%d", j)
if _, ok := peers[expectedID]; !ok {
t.Errorf("Agent %d: missing expected peer %s", i, expectedID)
}
}
}
}

Expand Down
Loading