9 "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/options"
10 "github.com/stretchr/testify/assert"
13func TestGracefulShutdown(t *testing.T) {
14 opts := options.NewOptions()
15 stop := make(chan struct{}, 1)
16 srv := Server{Handler: http.DefaultServeMux, Opts: opts, stop: stop}
24 stop <- struct{}{} // emulate catching signals
26 // An idiomatic for sync.WaitGroup with timeout
27 c := make(chan struct{})
34 case <-time.After(1 * time.Second):
35 t.Fatal("Server should return gracefully but timeout has occurred")
38 assert.Len(t, stop, 0) // check if stop chan is empty
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list