Skip to content

Commit f364d1f

Browse files
committed
Fix API handler for normal tests
1 parent 0359a7e commit f364d1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coderd/coderdtest/coderdtest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ func NewOptions(t *testing.T, options *Options) (func(http.Handler), context.Can
215215

216216
return func(h http.Handler) {
217217
mutex.Lock()
218+
defer mutex.Unlock()
218219
handler = h
219-
mutex.Unlock()
220220
}, cancelFunc, &coderd.Options{
221221
AgentConnectionUpdateFrequency: 150 * time.Millisecond,
222222
// Force a long disconnection timeout to ensure
@@ -278,7 +278,7 @@ func NewWithAPI(t *testing.T, options *Options) (*codersdk.Client, io.Closer, *c
278278
setHandler, cancelFunc, newOptions := NewOptions(t, options)
279279
// We set the handler after server creation for the access URL.
280280
coderAPI := coderd.New(newOptions)
281-
setHandler(coderAPI.APIHandler)
281+
setHandler(coderAPI.RootHandler)
282282
var provisionerCloser io.Closer = nopcloser{}
283283
if options.IncludeProvisionerDaemon {
284284
provisionerCloser = NewProvisionerDaemon(t, coderAPI)

0 commit comments

Comments
 (0)