Skip to content

Commit 9c067a5

Browse files
committed
Fix failing test on CRAN's r-devel-linux-x86_64-fedora-clang platform
1 parent 349a22c commit 9c067a5

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# reactable 0.4.2.9000 (Unreleased)
22

3+
* Fixed a failing CRAN check on the `r-devel-linux-x86_64-fedora-clang` platform. ([#308](https://github.com/glin/reactable/issues/308))
4+
35
# reactable 0.4.2
46

57
[Documentation - reactable 0.4.2](https://v0-4-2--reactable-docs.netlify.app/)

tests/testthat/test-reactable.R

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,22 @@ test_that("static rendering", {
13501350
# R package using DOWNLOAD_STATIC_LIBV8=true.
13511351
# https://github.com/jeroen/V8/issues/65
13521352
# https://bugzilla.redhat.com/show_bug.cgi?id=1755114
1353+
#
1354+
# On CRAN's fedora-clang platform, where V8 is installed with g++ and not clang, all
1355+
# uncaught exceptions cause V8 to seg fault, which causes this check and other error handling
1356+
# tests to fail. Skip all tests if running on a platform with this issue.
1357+
# See notes on CRAN's fedora-clang platform: https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-clang
1358+
#
1359+
# The test for the uncaught exception seg fault must be run in a separate R process.
1360+
# If a seg fault occurs, the output is typically: "free(): double free detected in tcache 2"
1361+
code <- "V8::new_context()$eval('not_defined')"
1362+
output <- suppressWarnings(
1363+
system2(R.home("bin/R"), c("-e", shQuote(code)), stdout = TRUE, stderr = TRUE)
1364+
)
1365+
if (attr(output, "status") > 0 && !grepl("ReferenceError", paste(output, collapse = "\n"))) {
1366+
skip(sprintf("V8 crashed on an uncaught exception, unable to run error handling tests.\nThis is probably V8 installed with g++ on fedora-clang. Test output:\n%s", paste(output, collapse = "\n")))
1367+
}
1368+
13531369
tryCatch({
13541370
V8::new_context()$eval("''.localeCompare('')")
13551371
}, error = function(e) {

0 commit comments

Comments
 (0)