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

valgrind issue about NA vs NaN #242

Closed
slowkow opened this issue Oct 12, 2023 · 1 comment
Closed

valgrind issue about NA vs NaN #242

slowkow opened this issue Oct 12, 2023 · 1 comment

Comments

@slowkow
Copy link
Owner

slowkow commented Oct 12, 2023

Prof Brian Ripley reported that valgrind has errors on some packages when it uses NaN instead of NA.

Here is the error log for ggrepel:

* using log directory ‘/data/blackswan/ripley/R/packages/tests-vg/ggrepel.Rcheck’
* using R Under development (unstable) (2023-10-05 r85268)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1)
    GNU Fortran (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1)
* running under: Fedora Linux 38 (Workstation Edition)
* using session charset: UTF-8
* using options ‘--use-valgrind --no-stop-on-test-error’
* checking for file ‘ggrepel/DESCRIPTION’ ... OK
* this is package ‘ggrepel’ version ‘0.9.3’
* package encoding: UTF-8
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package ‘ggrepel’ can be installed ... [25s/25s] OK
* used C++ compiler: ‘g++ (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1)’
* checking package directory ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking compiled code ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... [360s/362s] OK
* checking tests ...
  Running ‘testthat.R’ [15m/15m]
 [15m/15m] ERROR
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(withr)
  > library(testthat)
  > library(ggrepel)
  Loading required package: ggplot2
  > 
  > test_check("ggrepel")
  [ FAIL 2 | WARN 0 | SKIP 5 | PASS 70 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (5): 'test-just-with-angle.R:11:3', 'test-just-with-angle.R:51:3',
    'test-just-with-angle.R:91:3', 'test-just-with-angle.R:130:3',
    'test-just-with-angle.R:174:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-seed.R:76:3'): calling geom_text_repel with seed creates identical plots ──
  identical(pos1, pos2) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-seed.R:156:3'): calling geom_label_repel with seed creates identical plots ──
  identical(pos1, pos2) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  
  [ FAIL 2 | WARN 0 | SKIP 5 | PASS 70 ]
  Error: Test failures
  Execution halted
@slowkow
Copy link
Owner Author

slowkow commented Oct 12, 2023

This commit has the fix:
267e52c

The problem is solved by changing expect_true(identical(pos1, pos2)) to expect_equal(pos1, pos2)

Here is a log of a new run of valgrind where the error is no longer appearing: https://github.com/slowkow/ggrepel/actions/runs/6498978607/job/17651398979

@slowkow slowkow closed this as completed Oct 12, 2023
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

No branches or pull requests

1 participant