[R-package] allow for small numerical differences in Booster test #4714
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #4680 for background on this PR.
On the submission of v3.3.0 to CRAN, one test in the R package failed in one CRAN test setup (
r-devel-windows-x86_64-gcc10-UCRT
).This PR proposes using
testthat::expect_equal()
instead oftestthat::expect_identical()
on Windows in the relevant test, to reduce the risk of a rejected submission caused by small numerical precision differences.Notes for Reviewers
As noted in #4680, LightGBM's CI does not currently have a job replicating CRAN's UCRT tests, and I'm not aware of an easy way to replicate that job. Also, confusingly, CRAN re-ran the package's tests in that environment and the second time, they all passed: #4680 (comment).
With this PR, I'm just trying to be overly-cautious in the hope that it reduces the risk of
{lightgbm}
being removed from CRAN. I think that most users of the R package would prefer very small numeric precision issues on Windows to the package being entirely unavailable.