Skip to content

Commit

Permalink
fix: time in milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre818181 committed Jan 13, 2025
1 parent 65b39e3 commit 6f9963e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type Result struct {

ExpectedError string `json:"expectedError"`
ActualError string `json:"actualError"`
ExecutionTime int `json:"executionTime"`
ExecutionTime int64 `json:"executionTime"`
}

type Handler struct {
Expand Down Expand Up @@ -257,7 +257,7 @@ func cancelJob(timeout int, jobIndex int) {
ActualOutput: nil,
ExpectedError: "",
ActualError: "Execution timeout exceeded",
ExecutionTime: int(time.Since(testConfig[jobIndex].StartedAt).Milliseconds()),
ExecutionTime: time.Since(testConfig[jobIndex].StartedAt).Milliseconds(),
Mode: *testConfig[jobIndex].Mode,
})

Expand Down Expand Up @@ -316,7 +316,7 @@ func (h *Handler) JobDone(c *gin.Context) {
Name: lastTest.Name,
ExpectedOutput: lastTest.ExpectedOutput.Payload,
ActualOutput: actualOutput,
ExecutionTime: int(time.Since(lastTest.StartedAt).Seconds()),
ExecutionTime: time.Since(lastTest.StartedAt).Milliseconds(),
Status: "FAILED",
Mode: *lastTest.Mode,
})
Expand All @@ -334,7 +334,7 @@ func (h *Handler) JobDone(c *gin.Context) {
Name: lastTest.Name,
ExpectedOutput: lastTest.ExpectedOutput.Payload,
ActualOutput: actualOutput,
ExecutionTime: int(time.Since(lastTest.StartedAt).Seconds()),
ExecutionTime: time.Since(lastTest.StartedAt).Milliseconds(),
Status: "SUCCESS",
Mode: *lastTest.Mode,
})
Expand Down

0 comments on commit 6f9963e

Please sign in to comment.