Skip to content

Make test robust to R configuration/version/platform issue#5867

Merged
MichaelChirico merged 2 commits intomasterfrom
skip-test
Jan 3, 2024
Merged

Make test robust to R configuration/version/platform issue#5867
MichaelChirico merged 2 commits intomasterfrom
skip-test

Conversation

@MichaelChirico
Copy link
Copy Markdown
Member

Closes #5866

@jameslamb are you able to test the conda build against this PR? Would be great to confirm it's WAI on your end. If so we can merge and try to have this shipped in CRAN version 1.15.0.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 31, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4bc10a6) 97.47% compared to head (21e98e7) 97.47%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5867   +/-   ##
=======================================
  Coverage   97.47%   97.47%           
=======================================
  Files          80       80           
  Lines       14829    14829           
=======================================
  Hits        14454    14454           
  Misses        375      375           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jameslamb
Copy link
Copy Markdown
Contributor

Thanks for this! Yes I can test this in a conda-forge R 4.2 environment tomorrow.

@jameslamb
Copy link
Copy Markdown
Contributor

As of this branch, test.data.table() passes in an R 4.2 conda environment from conda-forge on my x86_64 Mac.

how I tested that (click me)
  • R version: 4.2.3
  • CPU: Intel i5
  • operating system: macOS 12.2.1
# create the environment
# NOTE: I use https://github.com/conda-forge/miniforge, so all packages installed will be from conda-forge
conda create \
    --yes \
    --name r42 \
    'r-base>=4.2,<4.3'

source activate r42

# build and install data.table from this branch
git clone \
    --branch skip-test \
    git@github.com:Rdatatable/data.table.git \
    /tmp/data.table

cd /tmp/data.table

"$CONDA_PREFIX/bin/R" CMD INSTALL .

# confirm that this version of R still has that timezone issue
env -i PATH=/usr/bin:/bin \
"$CONDA_PREFIX/bin/Rscript" -e 'as.POSIXct("1893-12-28 05:15:36", tz = "")'
# Error in as.POSIXlt.character(x, tz, ...) : 
#  character string is not in a standard unambiguous format
# Calls: as.POSIXct ... as.POSIXct.default -> as.POSIXct -> as.POSIXlt -> as.POSIXlt.character

# confirm that test.data.table() works
env -i PATH=/usr/bin:/bin LANG=en_US.UTF-8 \
"$CONDA_PREFIX/bin/Rscript" -e 'require("data.table"); data.table::test.data.table()'

That shows the following:

Tue Jan  2 20:07:42 2024  endian==little, sizeof(long double)==16, longdouble.digits==64, sizeof(pointer)==8, TZ==unset, Sys.timezone()=='America/Chicago', Sys.getlocale()=='en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8', l10n_info()=='MBCS=TRUE; UTF-8=TRUE; Latin-1=FALSE; codeset=UTF-8', getDTthreads()=='OpenMP version (_OPENMP)==202011; omp_get_num_procs()==4; R_DATATABLE_NUM_PROCS_PERCENT==unset (default 50); R_DATATABLE_NUM_THREADS==unset; R_DATATABLE_THROTTLE==unset (default 1024); omp_get_thread_limit()==2147483647; omp_get_max_threads()==4; OMP_THREAD_LIMIT==unset; OMP_NUM_THREADS==unset; RestoreAfterFork==true; data.table is using 2 threads with throttle==1024. See ?setDTthreads.', zlibVersion()==1.2.13 ZLIB_VERSION==1.2.13
10 longest running tests took 8s (43% of 19s)
      ID  time nTest
 1: 2155 1.515     5
 2: 1223 1.100   728
 3: 1438 0.932   354
 4: 1437 0.859    36
 5: 1252 0.812   484
 6: 1652 0.789    45
 7: 1648 0.759    45
 8: 1650 0.748    45
 9: 1639 0.604   149
10: 2233 0.506    52
All 10014 tests (last 2241.14) in tests/tests.Rraw completed ok in 23.5s elapsed (33.6s cpu)

Repeated that exact same method but with master, just to be sure this is a reliable check that this PR would resolve the issues from #5866.

cd ${HOME}
rm -rf /tmp/data.table

git clone \
    --branch master \
    git@github.com:Rdatatable/data.table.git \
    /tmp/data.table

cd /tmp/data.table

"$CONDA_PREFIX/bin/R" CMD INSTALL .

env -i PATH=/usr/bin:/bin LANG=en_US.UTF-8 \
"$CONDA_PREFIX/bin/Rscript" -e 'require("data.table"); data.table::test.data.table()'

And yes, that fails as observed in conda-forge/r-data.table-feedstock#35.

Error: 1 error(s) out of 10020. Search tests/tests.Rraw for test number(s) 2150.025. Duration: 27.2s elapsed (36.5s cpu).
In addition: Warning message:
Column 'times' was requested to be 'POSIXct' but fread encountered the following error:
        character string is not in a standard unambiguous format
so the column has been left as type 'character' 
Execution halted

Thanks for this!

@MichaelChirico
Copy link
Copy Markdown
Member Author

Great, thanks for checking! Merging since this should be a no op for other environments

@MichaelChirico MichaelChirico merged commit dc4c1ea into master Jan 3, 2024
@MichaelChirico MichaelChirico deleted the skip-test branch January 3, 2024 03:44
ben-schwen added a commit that referenced this pull request May 29, 2024
MichaelChirico added a commit that referenced this pull request Jun 2, 2024
…6146)

* Warning will not throw again now that it's captured in base_messages

* alter testcase to pre #5867 since warning is now captured with base_messages

---------

Co-authored-by: Benjamin Schwendinger <52290390+ben-schwen@users.noreply.github.com>
Co-authored-by: Benjamin Schwendinger <benjaminschwe@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some platforms/R configurations/versions fail an fread() test

2 participants