Skip to content

Commit b7a5a1b

Browse files
author
Mike Davis
authored
chore(dep): update to go-sdk v1.3.0 (#244)
* Update to the latest go-sdk release * Release includes official support for OptimizelyJSON variables * Fix flaky coverage reporting by waiting for full server shutdown
1 parent 505d333 commit b7a5a1b

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/go-kit/kit v0.9.0
1212
github.com/google/uuid v1.1.1
1313
github.com/lestrrat-go/jwx v0.9.0
14-
github.com/optimizely/go-sdk v1.3.0-beta2
14+
github.com/optimizely/go-sdk v1.3.0
1515
github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6
1616
github.com/rakyll/statik v0.1.7
1717
github.com/rs/zerolog v1.15.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLD
8989
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
9090
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
9191
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
92-
github.com/optimizely/go-sdk v1.3.0-beta2 h1:FIoCet9sIqlnkBzWHjDz22oD3BCmOYjzCODOMnn8TSY=
93-
github.com/optimizely/go-sdk v1.3.0-beta2/go.mod h1:ehZPiEzNzNJw98EFrZX1C9h9gVgVRCiWosQEVlgivCw=
92+
github.com/optimizely/go-sdk v1.3.0 h1:js9Cd5uTe8mWQuY66CsXperRueOjOE6UNN1mKGkEk1M=
93+
github.com/optimizely/go-sdk v1.3.0/go.mod h1:ehZPiEzNzNJw98EFrZX1C9h9gVgVRCiWosQEVlgivCw=
9494
github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6 h1:lNCW6THrCKBiJBpz8kbVGjC7MgdCGKwuvBgc7LoD6sw=
9595
github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI=
9696
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=

pkg/server/server_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"crypto/tls"
2121
"net/http"
2222
"net/http/httptest"
23-
"sync"
2423
"testing"
2524
"time"
2625

@@ -36,20 +35,21 @@ var handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
3635
var conf = config.ServerConfig{}
3736

3837
func TestStartAndShutdown(t *testing.T) {
39-
srv, err := NewServer("valid", "1000", handler, conf)
38+
srv, err := NewServer("valid", "6000", handler, conf)
4039
if !assert.NoError(t, err) {
4140
return
4241
}
4342

44-
wg := sync.WaitGroup{}
45-
wg.Add(1)
43+
start := make(chan struct{})
44+
finish := make(chan error)
4645
go func() {
47-
wg.Done()
48-
srv.ListenAndServe()
46+
close(start)
47+
finish <- srv.ListenAndServe()
4948
}()
5049

51-
wg.Wait()
50+
<-start
5251
srv.Shutdown()
52+
assert.NoError(t, <-finish)
5353
}
5454

5555
func TestNoHandler(t *testing.T) {
@@ -69,7 +69,7 @@ func TestFailedStartService(t *testing.T) {
6969
ns.ListenAndServe()
7070
}
7171

72-
func TestFailedTSLStartService(t *testing.T) {
72+
func TestFailedTLSStartService(t *testing.T) {
7373
cfg := config.ServerConfig{
7474
ReadTimeout: 3 * time.Second,
7575
WriteTimeout: 8 * time.Second,
@@ -93,7 +93,7 @@ func TestServerConfigs(t *testing.T) {
9393
assert.Equal(t, cfg.WriteTimeout, ns.srv.WriteTimeout)
9494
}
9595

96-
func TestTSLServerConfigs(t *testing.T) {
96+
func TestTLSServerConfigs(t *testing.T) {
9797
cfg := config.ServerConfig{
9898
ReadTimeout: 3 * time.Second,
9999
WriteTimeout: 8 * time.Second,

0 commit comments

Comments
 (0)