Skip to content

Commit 2fc98f6

Browse files
committed
address review nits in session-tracking tests
1 parent c591c72 commit 2fc98f6

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

pkg/server/http_server_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func TestSessionTotalMetric(t *testing.T) {
9696
},
9797
})
9898
require.NoError(t, err)
99-
defer store.Close()
99+
defer func() { _ = store.Close() }()
100100

101101
h := &HTTPServer{
102102
options: &Options{
@@ -110,7 +110,7 @@ func TestSessionTotalMetric(t *testing.T) {
110110
require.NoError(t, err)
111111
pubBytes, err := x509.MarshalPKIXPublicKey(&priv.PublicKey)
112112
require.NoError(t, err)
113-
pubPem := pem.EncodeToMemory(&pem.Block{Type: "RSA PUBLIC KEY", Bytes: pubBytes})
113+
pubPem := pem.EncodeToMemory(&pem.Block{Type: "PUBLIC KEY", Bytes: pubBytes})
114114
pubB64 := base64.StdEncoding.EncodeToString(pubPem)
115115

116116
correlationID := xid.New().String()

pkg/storage/roundtrip_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ func TestOnRemovalSessionTracking(t *testing.T) {
469469
OnRemoval: onRemoval,
470470
})
471471
require.NoError(t, err)
472-
defer db.Close()
472+
defer func() { _ = db.Close() }()
473473

474474
waitRemoval := func(msg string) {
475475
t.Helper()
@@ -507,6 +507,7 @@ func TestOnRemovalSessionTracking(t *testing.T) {
507507

508508
// Periodically access the cache to trigger lazy eviction.
509509
stop := make(chan struct{})
510+
defer close(stop)
510511
go func() {
511512
ticker := time.NewTicker(10 * time.Millisecond)
512513
defer ticker.Stop()
@@ -520,5 +521,4 @@ func TestOnRemovalSessionTracking(t *testing.T) {
520521
}
521522
}()
522523
waitRemoval("TTL eviction")
523-
close(stop)
524524
}

0 commit comments

Comments
 (0)