Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.data.table() no longer writes 'x' to .GlobalEnv #2830

Merged
merged 1 commit into from
May 3, 2018
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
5 changes: 2 additions & 3 deletions CRAN_Release.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,11 @@ cd ~/build/32bit/R-devel
make
alias Rdevel='~/build/R-devel/bin/R --vanilla'
cd ~/GitHub/data.table
Rdevel CMD INSTALL data.table_1.10.5.tar.gz
Rdevel CMD INSTALL data.table_1.11.1.tar.gz
# Check UBSAN and ASAN flags appear in compiler output above. Rdevel was compiled with
# them so should be passed through to here
Rdevel
install.packages(c("bit64","xts","nanotime","chron"), repos="http://cloud.r-project.org") # important to run all tests
# Skip compatibility tests with other Suggests packages; unlikely UBSAN/ASAN problems there.
install.packages(c("bit64","xts","nanotime","chron"), repos="http://cloud.r-project.org") # minimum packages needed to not skip any tests in test.data.table()
require(data.table)
test.data.table() # slower than usual, naturally, due to UBSAN and ASAN. Too slow to run R CMD check.
for (i in 1:10) test.data.table() # last resort: try several runs; e.g a few tests generate data with a non-fixed random seed
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#### BUG FIXES

1. `test.data.table()` created/overwrote variable `x` in `.GlobalEnv`, [#2828](https://github.com/Rdatatable/data.table/issues/2828); i.e. a modification of user's workspace which is not allowed. Thanks to @etienne-s for reporting.

#### NOTES


Expand Down
2 changes: 1 addition & 1 deletion R/test.data.table.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ test <- function(num,x,y=TRUE,error=NULL,warning=NULL,output=NULL) {
x = tryCatch(withCallingHandlers(x, warning=wHandler), error=eHandler)
# save the overhead of capture.output() since there are a lot of tests, often called in loops
} else {
out = capture.output(print(x <<- tryCatch(withCallingHandlers(x, warning=wHandler), error=eHandler)))
out = capture.output(print(x <- tryCatch(withCallingHandlers(x, warning=wHandler), error=eHandler)))
}
if (memtest) {
mem = as.list(c(inittime=inittime, timestamp=timestamp, test=num, ps_mem(), gc_mem())) # nocov
Expand Down