Skip to content

Commit

Permalink
fix(acceptance): Stop memory usage after specified duration
Browse files Browse the repository at this point in the history
Memory usage by the acceptance tests test app did not automatically stop
after the specified time.
  • Loading branch information
silvestre committed Jan 17, 2024
1 parent 73bbd14 commit ce2ea63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/acceptance/assets/app/go_app/internal/app/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func MemoryTests(logger logr.Logger, r *gin.RouterGroup, memoryTest MemoryGobble
memoryTest.UseMemory(memoryMiB * Mebi)
logMemoryUsage(logger, "after allocating memory")
memoryTest.Sleep(duration)
memoryTest.StopTest()
}()
c.JSON(http.StatusOK, gin.H{"memoryMiB": memoryMiB, "minutes": minutes})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ var _ = Describe("Memory tests", func() {
Expect(fakeMemoryTest.UseMemoryArgsForCall(0)).To(Equal(uint64(5 * app.Mebi)))
Eventually(func() int { return fakeMemoryTest.SleepCallCount() }).Should(Equal(1))
Expect(fakeMemoryTest.SleepArgsForCall(0)).To(Equal(4 * time.Minute))
Eventually(func() int { return fakeMemoryTest.StopTestCallCount() }).Should(Equal(1))
})
})
Context("memTest info tests", func() {
Expand Down

0 comments on commit ce2ea63

Please sign in to comment.