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 suite failures in 32bit architectures #312

Closed
tillea opened this issue Jan 9, 2023 · 2 comments · Fixed by #320
Closed

Test suite failures in 32bit architectures #312

tillea opened this issue Jan 9, 2023 · 2 comments · Fixed by #320

Comments

@tillea
Copy link

tillea commented Jan 9, 2023

Hi,
I have packaged clock for Debian. The test suite is run on several architectures. Unfortunately there are two failing tests for i386, armel and armhf. As an example here is the full test log for i386 which contains:

══ Skipped tests ═══════════════════════════════════════════════════════════════
• On CRAN (252)

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-posixt.R:151'): can group by year/month/day/hour/minute/second ──
date_group(z, "year") (`actual`) not identical to `expect` (`expected`).

    actual              | expected
[1] "-1-12-31 23:56:02" - "0-01-01" [1]
[2] "0-12-31 23:56:02"  - "1-01-01" [2]
[3] "1-12-31 23:56:02"  - "2-01-01" [3]
[4] "2-12-31 23:56:02"  - "3-01-01" [4]
[5] "3-12-31 23:56:02"  - "4-01-01" [5]
── Failure ('test-posixt.R:152'): can group by year/month/day/hour/minute/second ──
date_group(z, "year", n = 3) (`actual`) not identical to expect[c(1, 1, 1, 4, 4)] (`expected`).

    actual              | expected
[1] "-1-12-31 23:56:02" - "0-01-01" [1]
[2] "-1-12-31 23:56:02" - "0-01-01" [2]
[3] "-1-12-31 23:56:02" - "0-01-01" [3]
[4] "2-12-31 23:56:02"  - "3-01-01" [4]
[5] "2-12-31 23:56:02"  - "3-01-01" [5]

[ FAIL 2 | WARN 29 | SKIP 252 | PASS 1146 ]
Error: Test failures
Execution halted

This was reported in a Debian bug report.
Kind regards, Andreas.

@DavisVaughan
Copy link
Member

I believe this is actually the result of a base R bug on 32-bit Linux systems

Reproducible with:

docker run -ti --platform linux/386 debian:stable bash
apt update
apt install curl
apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common
apt install r-base
R

UTC example, everything looks good:

# MY COMPUTER (64 bit Mac)
> x <- as.POSIXct("0000-01-05", tz = "UTC") 
> x
[1] "0000-01-05 UTC"
> unclass(x)
[1] -62166873600
attr(,"tzone")
[1] "UTC"

# 32 BIT LINUX CONTAINER
> x <- as.POSIXct("0000-01-05", tz = "UTC")   
> x
[1] "0-01-05 UTC"
> unclass(x)
[1] -62166873600
attr(,"tzone")
[1] "UTC"

America/New_York example, this is weird - note the similar print output, but differing underlying numeric values:

# MY COMPUTER (64 bit Mac)
> x <- as.POSIXct("0000-01-05", tz = "America/New_York") 
> x
[1] "0000-01-05 LMT"
> unclass(x)
[1] -62166855838
attr(,"tzone")
[1] "America/New_York"

# 32 BIT LINUX CONTAINER
> x <- as.POSIXct("0000-01-05", tz = "America/New_York")
> x
[1] "0-01-05 EST"
> unclass(x)
[1] -62166855600
attr(,"tzone")
[1] "America/New_York"

If you take that Linux value of -62166855600 into my computer it shows

> .POSIXct(-62166855600, tz = "America/New_York")
[1] "0000-01-05 00:03:58 LMT"

which is exactly 3 minutes and 58 seconds off, which corresponds to the amount of difference seen in the failing test!

So I imagine this is a base R issue on 32 bit Linux somehow. I can report it to R-devel, and I'll just skip these tests on 32 bit systems.

@tillea
Copy link
Author

tillea commented Apr 14, 2023 via email

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 a pull request may close this issue.

2 participants