mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 23:55:47 -06:00
#11607 corrected file cleanup test
This commit is contained in:
parent
7818578d6a
commit
2565a8087c
@ -16,7 +16,7 @@ func TestCleanUpTmpFiles(t *testing.T) {
|
|||||||
}
|
}
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
secondAgo := now.Add(-time.Second)
|
secondAgo := now.Add(-time.Second)
|
||||||
dayAgo := now.Add(-time.Second * 3600 * 24 * 7)
|
twoDaysAgo := now.Add(-time.Second * 3600 * 24 * 2)
|
||||||
weekAgo := now.Add(-time.Second * 3600 * 24 * 7)
|
weekAgo := now.Add(-time.Second * 3600 * 24 * 7)
|
||||||
|
|
||||||
Convey("Should not cleanup recent files", func() {
|
Convey("Should not cleanup recent files", func() {
|
||||||
@ -24,7 +24,7 @@ func TestCleanUpTmpFiles(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
Convey("Should cleanup older files", func() {
|
Convey("Should cleanup older files", func() {
|
||||||
So(service.shouldCleanupTempFile(dayAgo, now), ShouldBeTrue)
|
So(service.shouldCleanupTempFile(twoDaysAgo, now), ShouldBeTrue)
|
||||||
})
|
})
|
||||||
|
|
||||||
Convey("After increasing temporary files lifetime, older files should be kept", func() {
|
Convey("After increasing temporary files lifetime, older files should be kept", func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user