summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/braintree/manners/transition_test.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-11-22 11:05:54 -0800
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-22 14:05:54 -0500
commit7961599b2e41c71720a42b3bfde641f7529f05fe (patch)
tree3c039e1d3790a954ba65fe551c7b348331bce994 /vendor/github.com/braintree/manners/transition_test.go
parente033dcce8e57ed6b6684227adf9b29347e4718b3 (diff)
downloadchat-7961599b2e41c71720a42b3bfde641f7529f05fe.tar.gz
chat-7961599b2e41c71720a42b3bfde641f7529f05fe.tar.bz2
chat-7961599b2e41c71720a42b3bfde641f7529f05fe.zip
PLT-4357 adding performance monitoring (#4622)
* WIP * WIP * Adding metrics collection * updating vendor packages * Adding metrics to config * Adding admin console page for perf monitoring * Updating glide * switching to tylerb/graceful
Diffstat (limited to 'vendor/github.com/braintree/manners/transition_test.go')
-rw-r--r--vendor/github.com/braintree/manners/transition_test.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/vendor/github.com/braintree/manners/transition_test.go b/vendor/github.com/braintree/manners/transition_test.go
deleted file mode 100644
index ffa06d3eb..000000000
--- a/vendor/github.com/braintree/manners/transition_test.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package manners
-
-import (
- "net/http"
- "strings"
- "testing"
-)
-
-func TestStateTransitions(t *testing.T) {
- tests := []transitionTest{
- transitionTest{[]http.ConnState{http.StateNew, http.StateActive}, 1},
- transitionTest{[]http.ConnState{http.StateNew, http.StateClosed}, 0},
- transitionTest{[]http.ConnState{http.StateNew, http.StateActive, http.StateClosed}, 0},
- transitionTest{[]http.ConnState{http.StateNew, http.StateActive, http.StateHijacked}, 0},
- transitionTest{[]http.ConnState{http.StateNew, http.StateActive, http.StateIdle}, 0},
- transitionTest{[]http.ConnState{http.StateNew, http.StateActive, http.StateIdle, http.StateActive}, 1},
- transitionTest{[]http.ConnState{http.StateNew, http.StateActive, http.StateIdle, http.StateActive, http.StateIdle}, 0},
- transitionTest{[]http.ConnState{http.StateNew, http.StateActive, http.StateIdle, http.StateActive, http.StateClosed}, 0},
- transitionTest{[]http.ConnState{http.StateNew, http.StateActive, http.StateIdle, http.StateActive, http.StateIdle, http.StateClosed}, 0},
- }
-
- for _, test := range tests {
- testStateTransition(t, test)
- }
-}
-
-type transitionTest struct {
- states []http.ConnState
- expectedWgCount int
-}
-
-func testStateTransition(t *testing.T, test transitionTest) {
- server := newServer()
- wg := newTestWg()
- server.wg = wg
- startServer(t, server, nil)
-
- conn := &fakeConn{}
- for _, newState := range test.states {
- server.ConnState(conn, newState)
- }
-
- server.Close()
- waiting := <-wg.waitCalled
- if waiting != test.expectedWgCount {
- names := make([]string, len(test.states))
- for i, s := range test.states {
- names[i] = s.String()
- }
- transitions := strings.Join(names, " -> ")
- t.Errorf("%s - Waitcount should be %d, got %d", transitions, test.expectedWgCount, waiting)
- }
-}