Skip to content

Commit

Permalink
fix time reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhwarrier committed Dec 21, 2023
1 parent 3516734 commit 025c458
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions integration-tests/load/automationv2_1/automationv2_1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ Load Config:
F: 1,
}

startTime := time.Now()
l.Info().Str("START_TIME", startTime.String()).Msg("Test setup started")
startTimeTestSetup := time.Now()
l.Info().Str("START_TIME", startTimeTestSetup.String()).Msg("Test setup started")

a.SetupAutomationDeployment(t)

Expand Down Expand Up @@ -522,15 +522,15 @@ Load Config:
configs = append(configs, c)
}

endTime := time.Now()
testSetupDuration := endTime.Sub(startTime)
endTimeTestSetup := time.Now()
testSetupDuration := endTimeTestSetup.Sub(startTimeTestSetup)
l.Info().
Str("END_TIME", endTime.String()).
Str("END_TIME", endTimeTestSetup.String()).
Str("Duration", testSetupDuration.String()).
Msg("Test setup ended")

ts, err := sendSlackNotification("Started", l, testEnvironment.Cfg.Namespace, strconv.Itoa(numberofNodes),
strconv.FormatInt(startTime.UnixMilli(), 10), "now",
strconv.FormatInt(startTimeTestSetup.UnixMilli(), 10), "now",
[]slack.Block{extraBlockWithText("\bTest Config\b\n```" + testConfig + "```")}, slack.MsgOptionBlocks())
if err != nil {
l.Error().Err(err).Msg("Error sending slack notification")
Expand All @@ -555,8 +555,8 @@ Load Config:
})
p.Add(g, err)

startTime = time.Now()
l.Info().Str("START_TIME", startTime.String()).Msg("Test execution started")
startTimeTestEx := time.Now()
l.Info().Str("START_TIME", startTimeTestEx.String()).Msg("Test execution started")

l.Info().Msg("Starting load generators")
_, err = p.Run(true)
Expand All @@ -566,10 +566,10 @@ Load Config:
l.Info().Str("STOP_WAIT_TIME", StopWaitTime.String()).Msg("Waiting for upkeeps to be performed")
time.Sleep(StopWaitTime)
l.Info().Msg("Finished waiting 60s for upkeeps to be performed")
endTime = time.Now()
testExDuration := endTime.Sub(startTime)
endTimeTestEx := time.Now()
testExDuration := endTimeTestEx.Sub(startTimeTestEx)
l.Info().
Str("END_TIME", endTime.String()).
Str("END_TIME", endTimeTestEx.String()).
Str("Duration", testExDuration.String()).
Msg("Test execution ended")

Expand All @@ -578,8 +578,8 @@ Load Config:
require.NoError(t, err, "Error getting latest block number")
l.Info().Uint64("Starting Block", startBlock).Uint64("Ending Block", endBlock).Msg("Test Block Range")

startTime = time.Now()
l.Info().Str("START_TIME", startTime.String()).Msg("Test reporting started")
startTimeTestReport := time.Now()
l.Info().Str("START_TIME", startTimeTestReport.String()).Msg("Test reporting started")

upkeepDelaysFast := make([][]int64, 0)
upkeepDelaysRecovery := make([][]int64, 0)
Expand Down Expand Up @@ -759,10 +759,10 @@ Total Events Missed: %d
Percent Missed: %f
Test Duration: %s`

endTime = time.Now()
testReDuration := endTime.Sub(startTime)
endTimeTestReport := time.Now()
testReDuration := endTimeTestReport.Sub(startTimeTestReport)
l.Info().
Str("END_TIME", endTime.String()).
Str("END_TIME", endTimeTestReport.String()).
Str("Duration", testReDuration.String()).
Msg("Test reporting ended")

Expand All @@ -771,7 +771,7 @@ Test Duration: %s`
len(allUpkeepDelaysRecovery), numberOfEventsEmitted, eventsMissed, percentMissed, testExDuration.String())

_, err = sendSlackNotification("Finished", l, testEnvironment.Cfg.Namespace, strconv.Itoa(numberofNodes),
strconv.FormatInt(startTime.UnixMilli(), 10), strconv.FormatInt(time.Now().UnixMilli(), 10),
strconv.FormatInt(startTimeTestSetup.UnixMilli(), 10), strconv.FormatInt(time.Now().UnixMilli(), 10),
[]slack.Block{extraBlockWithText("\bTest Report\b\n```" + testReport + "```")}, slack.MsgOptionTS(ts))
if err != nil {
l.Error().Err(err).Msg("Error sending slack notification")
Expand Down

0 comments on commit 025c458

Please sign in to comment.