Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 4 additions & 6 deletions targets/spiperf/fsm/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import (
"github.com/go-openapi/strfmt/conv"
)

const TimeFormatString = time.RFC3339Nano

// Client FSM that handles client mode.
type Client struct {
// PeerCmdOut sends commands to the peer's Server FSM.
Expand Down Expand Up @@ -293,7 +291,7 @@ Done:

case msg.PeerDisconnectLocalType, msg.PeerDisconnectRemoteType:
// Return an error here. Peer should not have disconnected.
err := processUnexpectedPeerDisconnect(notif)
err := c.processUnexpectedPeerDisconnect(notif)
return (*Client).cleanup, err

default:
Expand Down Expand Up @@ -408,7 +406,7 @@ Done:

case msg.PeerDisconnectLocalType, msg.PeerDisconnectRemoteType:
// Return an error here. Peer should not have disconnected.
err := processUnexpectedPeerDisconnect(notif)
err := c.processUnexpectedPeerDisconnect(notif)
return (*Client).cleanup, err

default:
Expand Down Expand Up @@ -616,7 +614,7 @@ func (c *Client) waitForPeerResponse(expectedType string) (*msg.Message, error)

switch notif.Type {
case msg.PeerDisconnectLocalType, msg.PeerDisconnectRemoteType:
return nil, processUnexpectedPeerDisconnect(notif)
return nil, c.processUnexpectedPeerDisconnect(notif)

case msg.StatsNotificationType:
// Sometimes upstream-only tests can have an in-flight stats notification from
Expand Down Expand Up @@ -666,7 +664,7 @@ func (c *Client) handleStatsNotification(notif *msg.Message) error {
return nil
}

func processUnexpectedPeerDisconnect(notif *msg.Message) error {
func (c *Client) processUnexpectedPeerDisconnect(notif *msg.Message) error {

switch notif.Type {
case msg.PeerDisconnectLocalType:
Expand Down
5 changes: 5 additions & 0 deletions targets/spiperf/fsm/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ const (
DefaultStartDelay = 3 * time.Second
DefaultStatsPollInterval = 1 * time.Second
DefaultGeneratorPollInterval = 1 * time.Second
TimeFormatString = time.RFC3339Nano

// MaximumStartTimeDelta maximum time in the future to start traffic.
// This value is somewhat arbitrary.
MaximumStartTimeDelta = 3 * time.Minute
)
Loading