Skip to content

Commit dba359f

Browse files
committed
fix
1 parent 3e29d8f commit dba359f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

dbos/admin_server_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ func TestAdminServer(t *testing.T) {
151151
body: bytes.NewBuffer(mustMarshal(map[string]any{
152152
"workflow_uuids": []string{"test-id-1", "test-id-2"},
153153
"authenticated_user": "test-user",
154-
"start_time": time.Now().Add(-24 * time.Hour).Format(time.RFC3339),
155-
"end_time": time.Now().Format(time.RFC3339),
154+
"start_time": time.Now().Add(-24 * time.Hour).Format(time.RFC3339Nano),
155+
"end_time": time.Now().Format(time.RFC3339Nano),
156156
"status": "PENDING",
157157
"application_version": "v1.0.0",
158158
"workflow_name": "testWorkflow",
@@ -249,7 +249,6 @@ func TestAdminServer(t *testing.T) {
249249
assert.Equal(t, "result-workflow1", result1)
250250

251251
// Record time between workflows
252-
time.Sleep(500 * time.Millisecond)
253252
timeBetween := time.Now()
254253
time.Sleep(500 * time.Millisecond)
255254

@@ -263,7 +262,7 @@ func TestAdminServer(t *testing.T) {
263262

264263
// Test 1: Query with start_time before timeBetween (should get both workflows)
265264
reqBody1 := map[string]any{
266-
"start_time": timeBetween.Add(-2 * time.Second).Format(time.RFC3339),
265+
"start_time": timeBetween.Add(-2 * time.Second).Format(time.RFC3339Nano),
267266
"limit": 10,
268267
}
269268
req1, err := http.NewRequest(http.MethodPost, endpoint, bytes.NewBuffer(mustMarshal(reqBody1)))
@@ -305,7 +304,7 @@ func TestAdminServer(t *testing.T) {
305304

306305
// Test 2: Query with start_time after timeBetween (should get only second workflow)
307306
reqBody2 := map[string]any{
308-
"start_time": timeBetween.Format(time.RFC3339),
307+
"start_time": timeBetween.Format(time.RFC3339Nano),
309308
"limit": 10,
310309
}
311310
fmt.Println("Request body 2:", reqBody2, "timebetween", timeBetween.UnixMilli())
@@ -334,7 +333,7 @@ func TestAdminServer(t *testing.T) {
334333

335334
// Also test end_time filter
336335
reqBody3 := map[string]any{
337-
"end_time": timeBetween.Format(time.RFC3339),
336+
"end_time": timeBetween.Format(time.RFC3339Nano),
338337
"limit": 10,
339338
}
340339
req3, err := http.NewRequest(http.MethodPost, endpoint, bytes.NewBuffer(mustMarshal(reqBody3)))

0 commit comments

Comments
 (0)