Copilot commented on code in PR #4939:
URL: https://github.com/apache/arrow-adbc/pull/4939#discussion_r4344728019
##########
r/adbcdrivermanager/tests/testthat/test-error.R:
##########
@@ -41,6 +41,33 @@ test_that("error allocator works", {
expect_identical(err$details, setNames(list(), character()))
})
+test_that("stop_for_error() does not truncate long error messages", {
+ # Long messages (e.g., the list of paths searched for a driver manifest)
+ # should not be cut off at the default warning.length of 1000 characters
+ old_options <- options(warning.length = 1000L)
+ on.exit(options(old_options))
+
+ warning_length_while_signalled <- NULL
+ had_error <- FALSE
+ tryCatch(
+ withCallingHandlers(
+ adbc_driver(paste0("not_a_driver_", strrep("x", 1000))),
Review Comment:
This creates a 1,013-byte filename component, exceeding the common 255-byte
filesystem limit. If `ADBC_DRIVER_PATH` points to an existing directory, or a
searched user/system driver directory exists, `SearchPathsForDriver()` checks
`<directory>/<name>.toml` using the throwing `std::filesystem::exists()`
overload. The resulting uncaught `filesystem_error` can abort R before either
handler runs. Disable environment, user, and system manifest searches for this
synthetic long-name test so it reaches the intended driver-loading error
independently of the machine's configuration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]