Skip to content

Commit

Permalink
Increase binding req timeout value
Browse files Browse the repository at this point in the history
Resolves #255
  • Loading branch information
enobufs committed Jul 26, 2020
1 parent 1f59642 commit 5d2bbc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion agent_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
maxBufferSize = 1000 * 1000 // 1MB

// wait time before binding requests can be deleted
maxBindingRequestTimeout = 500 * time.Millisecond
maxBindingRequestTimeout = 4000 * time.Millisecond
)

var (
Expand Down
10 changes: 5 additions & 5 deletions agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1208,20 +1208,20 @@ func TestBindingRequestTimeout(t *testing.T) {

now := time.Now()
a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{
timestamp: now,
timestamp: now, // valid
})
a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{
timestamp: now.Add(-25 * time.Millisecond),
timestamp: now.Add(-3900 * time.Millisecond), // valid
})
a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{
timestamp: now.Add(-750 * time.Millisecond),
timestamp: now.Add(-4100 * time.Millisecond), // invalid
})
a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{
timestamp: now.Add(-75 * time.Hour),
timestamp: now.Add(-75 * time.Hour), // invalid
})

a.invalidatePendingBindingRequests(now)
assert.Equal(t, len(a.pendingBindingRequests), expectedRemovalCount, "Binding invalidation due to timeout did not remove the correct number of binding requests")
assert.Equal(t, expectedRemovalCount, len(a.pendingBindingRequests), "Binding invalidation due to timeout did not remove the correct number of binding requests")
assert.NoError(t, a.Close())
}

Expand Down

0 comments on commit 5d2bbc8

Please sign in to comment.