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

persistent: Test failure on 32-bit arches with GHC 9.0.2 #1414

Open
swt2c opened this issue Aug 2, 2022 · 5 comments · May be fixed by #1429
Open

persistent: Test failure on 32-bit arches with GHC 9.0.2 #1414

swt2c opened this issue Aug 2, 2022 · 5 comments · May be fixed by #1429

Comments

@swt2c
Copy link

swt2c commented Aug 2, 2022

Over in Debian unstable, we're seeing a test failure on all 32-bit architectures (armel, armhf, i386, mipsel) when building persistent 2.13.3.5:

Failures:

  test/Database/Persist/THSpec.hs:240:26: 
  1) Database.Persist.THSpec.HasIdDef should have correct underlying sql type
       expected: SqlInt64
        but got: SqlInt32

  To rerun use: --match "/Database/Persist/THSpec/HasIdDef/should have correct underlying sql type/"

Randomized with seed 10835329

Finished in 0.2322 seconds
231 examples, 1 failure, 3 pending
Test suite test: FAIL
Test suite logged to: dist-ghc/test/persistent-2.13.3.5-test.log

The tests are passing on 64-bit architectures (amd64, arm64, mips64el, ppc64el, s390x).

Full build logs for armel are available here: https://buildd.debian.org/status/fetch.php?pkg=haskell-persistent&arch=armel&ver=2.13.3.5-1&stamp=1659384152&raw=0

@swt2c
Copy link
Author

swt2c commented Oct 10, 2022

Ping - anything we can do to help debug/fix this issue?

@parsonsmatt parsonsmatt linked a pull request Oct 10, 2022 that will close this issue
7 tasks
@parsonsmatt
Copy link
Collaborator

I think this will do it: https://github.com/yesodweb/persistent/pull/1429/files

The test assumed that Int is represented in SQL as a 64 bit integer, but the instance actually cases on "how many bits are in an Int", and on 32 bit platforms, that's obviously 32.

I don't have a means for testing on 32 bit machines. Since it is a "test suite bug" I would recommend not running tests on 32 bit machines for this package until that PR is merged and a release including it is made.

@swt2c
Copy link
Author

swt2c commented Oct 10, 2022

Thanks for the quick fix! I can probably test it on a 32-bit machine...

@swt2c
Copy link
Author

swt2c commented Oct 11, 2022

Tested on an i386 chroot, now I'm seeing two failures:

Failures:

  test/Database/Persist/THSpec.hs:216:26: 
  1) Database.Persist.THSpec.HasDefaultId should have correct underlying sql type
       expected: SqlInt32
        but got: SqlInt64

  To rerun use: --match "/Database/Persist/THSpec/HasDefaultId/should have correct underlying sql type/"

  test/Database/Persist/THSpec.hs:244:26: 
  2) Database.Persist.THSpec.HasIdDef should have correct underlying sql type
       expected: SqlInt64
        but got: SqlInt32

  To rerun use: --match "/Database/Persist/THSpec/HasIdDef/should have correct underlying sql type/"

Randomized with seed 2106055493

Finished in 0.2276 seconds
231 examples, 2 failures, 3 pending
Test suite test: FAIL
Test suite logged to: dist-ghc/test/persistent-2.13.3.5-test.log
0 of 1 test suites (0 of 1 test cases) passed.

Looking at your patch, though, it seems that perhaps the change should have been applied in the HasIdDef section, not the `HadDefaultId' section?

@swt2c
Copy link
Author

swt2c commented Oct 12, 2022

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