feat: execute durable client commands through supervisor
This commit is contained in:
@@ -238,6 +238,25 @@ func dialAndHello(t *testing.T, server *httptest.Server, clientID, instanceID st
|
||||
connection.CloseNow()
|
||||
t.Fatalf("welcome payload = %T", welcome.Payload)
|
||||
}
|
||||
// Reconnecting agents receive an advisory target list immediately after
|
||||
// welcome. Consume it here so callers that exercise fencing or malformed
|
||||
// frames observe the next read from the actual session boundary.
|
||||
readContext, cancel = context.WithTimeout(context.Background(), time.Second)
|
||||
defer cancel()
|
||||
messageType, advisoryBytes, err := connection.Read(readContext)
|
||||
if err != nil {
|
||||
connection.CloseNow()
|
||||
t.Fatal(err)
|
||||
}
|
||||
if messageType != websocket.MessageBinary {
|
||||
connection.CloseNow()
|
||||
t.Fatalf("reconciliation message type = %v", messageType)
|
||||
}
|
||||
var advisory rvboxv1.AgentEnvelope
|
||||
if err := proto.Unmarshal(advisoryBytes, &advisory); err != nil || advisory.GetReconcileRequest() == nil {
|
||||
connection.CloseNow()
|
||||
t.Fatalf("reconciliation advisory = %+v, %v", advisory.Payload, err)
|
||||
}
|
||||
return connection, &welcome
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user