Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

* Test setup was tweaked to not trigger a spurious valgrind report from libcrypto (#461)

* Test setup was tweaked to make a group comparison more resilient to ordering (#462)


# tiledb 0.15.0

Expand Down
43 changes: 25 additions & 18 deletions inst/tinytest/test_group.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,28 @@ grp <- tiledb_group_close(grp)
grp <- tiledb_group_open(grp, "READ")
expect_equal(tiledb_group_member_count(grp), 2)

## remainder fragile on Fedora
if (isFALSE(tiledb:::.isFedora())) {
obj <- tiledb_group_member(grp, 0)
expect_equal(length(obj), 3)
expect_true(is.character(obj[1]))
expect_equal(obj[1], "ARRAY")
expect_true(is.character(obj[2]))
expect_equal(obj[2], file.path(tiledb_group_uri(grp), "chloe"))
expect_true(is.character(obj[3]))
expect_equal(obj[3], "name_is_chloe")

obj <- tiledb_group_member(grp, 1) # group member with no name
expect_equal(obj[3], "")

txt <- tiledb_group_member_dump(grp, TRUE)
dat <- read.csv(text=txt, sep=' ', header=FALSE)
expect_equal(nrow(dat), 1+2) # one for header 'filename GROUP'
}
obj <- tiledb_group_member(grp, 0)
expect_equal(length(obj), 3)
expect_true(is.character(obj[1]))
expect_equal(obj[1], "ARRAY")
expect_true(is.character(obj[2]))
## there appears to be non-determinism here that between remaining
## group members 0 and 1, we do not always get the same order:
## often chloe first then anny; but sometimes anny first, then chloe
## this is likely due to us writing several small objects 'in bulk'
## so they end up with identical timestamps, so an added sleep may
## help but as only two elements remain testing _both_ with a proper
## 'or' clause is an alternative
expect_true(obj[2] %in% c(file.path(tiledb_group_uri(grp), "chloe"),
file.path(tiledb_group_uri(grp), "anny")))
expect_true(is.character(obj[3]))
expect_true(obj[3] %in% c("name_is_chloe", ""))

obj <- tiledb_group_member(grp, 1) # group member with no name
expect_true(obj[2] %in% c(file.path(tiledb_group_uri(grp), "chloe"),
file.path(tiledb_group_uri(grp), "anny")))
expect_true(obj[3] %in% c("name_is_chloe", ""))

txt <- tiledb_group_member_dump(grp, TRUE)
dat <- read.csv(text=txt, sep=' ', header=FALSE)
expect_equal(nrow(dat), 1+2) # one for header 'filename GROUP'