Skip to content

Instantly share code, notes, and snippets.

@wch
Last active April 6, 2017 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wch/2596a1c9f1bcdee91bb210c782141c88 to your computer and use it in GitHub Desktop.
Save wch/2596a1c9f1bcdee91bb210c782141c88 to your computer and use it in GitHub Desktop.
Pool bug repro

Test failure on Pool package

This repository contains information to reproduce a test failure on the pool package.

First, clone this gist and enter the directory. Then build the Docker image:

git clone git@gist.github.com:2596a1c9f1bcdee91bb210c782141c88.git pool-test2
cd pool-test2

docker build -t pooltest2 .

This builds an image with the heisenbug branch of pool, saved at /pool-heisenbug.tar.gz.

To reproduce the error, start up a container and run:

docker run --rm -ti pooltest2 /bin/bash

RD CMD INSTALL /pool-heisenbug.tar.gz  --install-tests

cd /usr/local/lib/R/site-library/pool/tests
RD -e 'source("testthat.R")'

The tests can also be run with gdb or valgrind:

# gdb (after starting gdb, type 'r' to run)
RD -d gdb -e 'source("testthat.R")'
r

# Valgrind
RD -d valgrind -e 'source("testthat.R")'

You can also mount your local pool directory so that you can edit/build/install/test quickly:

# Start container
# NOTE: Change this path to mount your pool directory
docker run --rm -ti -v /Users/winston/Dropbox/Projects/pool:/pool pooltest2 /bin/bash


# Each time you modify the code, run the commands below to install and run tests
cd /
RD CMD build /pool --no-build-vignettes
RD CMD INSTALL /pool_0.1.0.tar.gz --install-tests

cd /usr/local/lib/R/site-library/pool/tests
RD -e 'source("testthat.R")'
FROM rocker/r-devel
ARG DEBIAN_FRONTED=noninteractive
RUN apt-get update && apt-get install -y valgrind
RUN RD -e "install.packages(c('DBI', 'R6', 'testthat'), Ncpus=4)"
COPY pool-heisenbug.tar.gz /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment