From 6b3c8a654003f6aaad2efd8e7ebd900c9159d043 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Tue, 1 Feb 2022 12:32:03 -0600 Subject: [PATCH 1/4] unload arrow package at end of test file --- inst/tinytest/test_arrowio.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inst/tinytest/test_arrowio.R b/inst/tinytest/test_arrowio.R index 26aac2629e..0ae99b752c 100644 --- a/inst/tinytest/test_arrowio.R +++ b/inst/tinytest/test_arrowio.R @@ -177,3 +177,5 @@ for (i in c(1:7,9:10)) { expect_equivalent(df[,i], 1:10) } expect_equivalent(df[,8], as.integer64(1:10)) + +detach(package:arrow, unload=TRUE) From fb69735579e5c4afb5973d2229386613f1d10037 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Tue, 1 Feb 2022 12:32:30 -0600 Subject: [PATCH 2/4] reactivate schema tests --- inst/tinytest/test_tiledbarray.R | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/inst/tinytest/test_tiledbarray.R b/inst/tinytest/test_tiledbarray.R index 55d5d3ec2c..a71da55adc 100644 --- a/inst/tinytest/test_tiledbarray.R +++ b/inst/tinytest/test_tiledbarray.R @@ -991,17 +991,15 @@ expect_equal(tiledb_array_get_non_empty_domain_from_name(arr, "d1"), c(1, 3)) expect_equal(tiledb_array_get_non_empty_domain_from_index(arr, 2), c("a", "c")) expect_equal(tiledb_array_get_non_empty_domain_from_name(arr, "d2"), c("a", "c")) -if (FALSE) { # this tests fine in isolation but croaks in bulk - ## access schema from uri - schema2 <- schema(tmp) - expect_true(is(schema2, "tiledb_array_schema")) - expect_equal(schema, schema2) - - ## access schema from array - schema3 <- schema(arr) - expect_true(is(schema3, "tiledb_array_schema")) - expect_equal(schema, schema3) -} +## access schema from uri +schema2 <- schema(tmp) +expect_true(is(schema2, "tiledb_array_schema")) +expect_equal(schema, schema2) + +## access schema from array +schema3 <- schema(arr) +expect_true(is(schema3, "tiledb_array_schema")) +expect_equal(schema, schema3) ## time travel tmp <- tempfile() From 1a9254e2f590b6ad455acc453e5ea8d28aa429e3 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Tue, 1 Feb 2022 13:14:04 -0600 Subject: [PATCH 3/4] also deactivate detach again --- inst/tinytest/test_arrowio.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/tinytest/test_arrowio.R b/inst/tinytest/test_arrowio.R index 0ae99b752c..70b2f0c0c4 100644 --- a/inst/tinytest/test_arrowio.R +++ b/inst/tinytest/test_arrowio.R @@ -178,4 +178,4 @@ for (i in c(1:7,9:10)) { } expect_equivalent(df[,8], as.integer64(1:10)) -detach(package:arrow, unload=TRUE) +#detach(package:arrow, unload=TRUE) From 2fe183c042afc4487a40dce091855acadce5174f Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Tue, 1 Feb 2022 16:35:02 -0600 Subject: [PATCH 4/4] refine arrow cleanup some more --- inst/tinytest/test_arrowio.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inst/tinytest/test_arrowio.R b/inst/tinytest/test_arrowio.R index 70b2f0c0c4..5d1307c306 100644 --- a/inst/tinytest/test_arrowio.R +++ b/inst/tinytest/test_arrowio.R @@ -178,4 +178,6 @@ for (i in c(1:7,9:10)) { } expect_equivalent(df[,8], as.integer64(1:10)) -#detach(package:arrow, unload=TRUE) +## detaching arrow should not be necessary as we generally do not need to unload +## packages but had been seen as beneficial in some instanced so there is now an option +if (Sys.getenv("R_TESTING_CLEANUP", "") == "yes") detach(package:arrow, unload=TRUE)