diff --git a/DESCRIPTION b/DESCRIPTION index 907437d..49671ba 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: rotor Title: Log Rotation and Conditional Backups -Version: 0.3.1 +Version: 0.3.2 Authors@R: person(given = "Stefan", family = "Fleck", diff --git a/R/Cache.R b/R/Cache.R index 2ea349f..8afa7e3 100644 --- a/R/Cache.R +++ b/R/Cache.R @@ -333,7 +333,8 @@ Cache <- R6::R6Class( ) row.names(res) <- NULL - res[order(res$mtime), ] + assert(!is.null(res$mtime)) + res[order(res$mtime, res$key), ] }, size = function(){ diff --git a/cran-comments.md b/cran-comments.md index f7518fd..f205cd3 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -10,21 +10,12 @@ 0 errors | 0 warnings | 0 notes -* fixes time zone related issue in `Cache$prune()` that causes macOS tests to fail -* more robust cleanup of temporary files between some tests -* resubmission that improves one test where - `https://cran.r-project.org/web/checks/check_results_rotor.html` shows an - error that I could not reproduce on any machine available on rhub. - Hopefully the test succeedes now, but if not it will give me more useful - debug information for another resubmission. +Sorry for the many resubmissions. This package currently has an issue that +only to occur on macOS. It does not occur on the same macOS version available +on Rhub. - -Notes: - -There was a timezone related issue that only occured on macos. I fixed it and -was able to test it on macOS 10.13.6 High Sierra with R-release (but not devel) -on Rhub. - -I could not reproduce the other errors; however, it looks as if they were caused -by improperly cleaned-up temporary files between failing tests. I made the -cleanup code a bit more robust and hope the problem is fixed now. +My current theory is that the error is caused by the accuracy of the +'mtime' filestamp, which is linked to the file system the machine uses. +I implemented a workaround under that assumption, but I cannot be 100% sure +that this fixes that error. If the error still persists... could you please +inform me which file system you use on r-release-macos-x86_64? diff --git a/tests/testthat/test_Cache.R b/tests/testthat/test_Cache.R index 0572153..1607e71 100644 --- a/tests/testthat/test_Cache.R +++ b/tests/testthat/test_Cache.R @@ -70,9 +70,7 @@ test_that("pruning works by number of files works", { # be added to the cache once cache <- Cache$new(td, hashfun = function(x) uuid::UUIDgenerate()) k1 <- cache$push(iris) - Sys.sleep(1) k2 <- cache$push(letters) - Sys.sleep(1) k3 <- cache$push(cars) expect_identical(cache$n, 3L) @@ -81,7 +79,6 @@ test_that("pruning works by number of files works", { expect_identical(cache$files$key[[3]], k3) cache$prune(max_files = 2) - cache$files expect_identical(cache$read(cache$files$key[[1]]), letters) expect_identical(cache$read(cache$files$key[[2]]), cars) cache$purge()