Skip to content

Commit 3607d0f

Browse files
committed
should not need this
1 parent b2d5b8b commit 3607d0f

File tree

1 file changed

+6
-36
lines changed

1 file changed

+6
-36
lines changed

dbos/admin_server_test.go

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,7 @@ func TestAdminServer(t *testing.T) {
3838
time.Sleep(100 * time.Millisecond)
3939

4040
// Verify admin server is not running
41-
client := &http.Client{
42-
Timeout: 1 * time.Second,
43-
Transport: &http.Transport{
44-
DisableKeepAlives: true,
45-
},
46-
}
41+
client := &http.Client{Timeout: 1 * time.Second}
4742
_, err = client.Get(fmt.Sprintf("http://localhost:3001/%s", strings.TrimPrefix(_HEALTHCHECK_PATTERN, "GET /")))
4843
require.Error(t, err, "Expected request to fail when admin server is not started")
4944

@@ -84,12 +79,7 @@ func TestAdminServer(t *testing.T) {
8479
exec := ctx.(*dbosContext)
8580
require.NotNil(t, exec.adminServer, "Expected admin server to be created in DBOS instance")
8681

87-
client := &http.Client{
88-
Timeout: 5 * time.Second,
89-
Transport: &http.Transport{
90-
DisableKeepAlives: true,
91-
},
92-
}
82+
client := &http.Client{Timeout: 5 * time.Second}
9383

9484
type adminServerTestCase struct {
9585
name string
@@ -270,12 +260,7 @@ func TestAdminServer(t *testing.T) {
270260
// Give the server a moment to start
271261
time.Sleep(100 * time.Millisecond)
272262

273-
client := &http.Client{
274-
Timeout: 5 * time.Second,
275-
Transport: &http.Transport{
276-
DisableKeepAlives: true,
277-
},
278-
}
263+
client := &http.Client{Timeout: 5 * time.Second}
279264
endpoint := fmt.Sprintf("http://localhost:3001/%s", strings.TrimPrefix(_WORKFLOWS_PATTERN, "POST /"))
280265

281266
// Create workflows with different input/output types
@@ -399,12 +384,7 @@ func TestAdminServer(t *testing.T) {
399384
}
400385
}()
401386

402-
client := &http.Client{
403-
Timeout: 5 * time.Second,
404-
Transport: &http.Transport{
405-
DisableKeepAlives: true,
406-
},
407-
}
387+
client := &http.Client{Timeout: 5 * time.Second}
408388
endpoint := fmt.Sprintf("http://localhost:3001/%s", strings.TrimPrefix(_WORKFLOWS_PATTERN, "POST /"))
409389

410390
// Create first workflow
@@ -575,12 +555,7 @@ func TestAdminServer(t *testing.T) {
575555
err = ctx.Launch()
576556
require.NoError(t, err)
577557

578-
client := &http.Client{
579-
Timeout: 5 * time.Second,
580-
Transport: &http.Transport{
581-
DisableKeepAlives: true,
582-
},
583-
}
558+
client := &http.Client{Timeout: 5 * time.Second}
584559

585560
// Ensure cleanup
586561
defer func() {
@@ -650,12 +625,7 @@ func TestAdminServer(t *testing.T) {
650625
err = ctx.Launch()
651626
require.NoError(t, err)
652627

653-
client := &http.Client{
654-
Timeout: 5 * time.Second,
655-
Transport: &http.Transport{
656-
DisableKeepAlives: true,
657-
},
658-
}
628+
client := &http.Client{Timeout: 5 * time.Second}
659629

660630
// Ensure cleanup
661631
defer func() {

0 commit comments

Comments
 (0)