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_source_mtime_long_long fails on 32bit platforms #5046

Closed
3 of 4 tasks
mimi1vx opened this issue Apr 4, 2019 · 3 comments
Closed
3 of 4 tasks

test_source_mtime_long_long fails on 32bit platforms #5046

mimi1vx opened this issue Apr 4, 2019 · 3 comments
Labels
status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity

Comments

@mimi1vx
Copy link
Contributor

mimi1vx commented Apr 4, 2019

fix in #5045

  • Include a detailed description of the bug or suggestion
  • pip list of the virtual environment you are using
  • pytest and operating system versions
  • Minimal example if possible

pytest-4.4.0 on openSUSE:Tumbleweed i586

[  348s] =================================== FAILURES ===================================
[  348s] _______________________ test_source_mtime_long_long[-1] ________________________
[  348s] 
[  348s] testdir = <Testdir local('/tmp/pytest-of-abuild/pytest-0/test_source_mtime_long_long0')>
[  348s] offset = -1
[  348s] 
[  348s]     @pytest.mark.parametrize("offset", [-1, +1])
[  348s]     def test_source_mtime_long_long(testdir, offset):
[  348s]         """Support modification dates after 2038 in rewritten files (#4903).
[  348s]     
[  348s]         pytest would crash with:
[  348s]     
[  348s]                 fp.write(struct.pack("<ll", mtime, size))
[  348s]             E   struct.error: argument out of range
[  348s]         """
[  348s]         p = testdir.makepyfile(
[  348s]             """
[  348s]             def test(): pass
[  348s]         """
[  348s]         )
[  348s]         # use unsigned long timestamp which overflows signed long,
[  348s]         # which was the cause of the bug
[  348s]         # +1 offset also tests masking of 0xFFFFFFFF
[  348s]         timestamp = 2 ** 32 + offset[  348s] =================================== FAILURES ===================================
[  348s] _______________________ test_source_mtime_long_long[-1] ________________________
[  348s] 
[  348s] testdir = <Testdir local('/tmp/pytest-of-abuild/pytest-0/test_source_mtime_long_long0')>
[  348s] offset = -1
[  348s] 
[  348s]     @pytest.mark.parametrize("offset", [-1, +1])
[  348s]     def test_source_mtime_long_long(testdir, offset):
[  348s]         """Support modification dates after 2038 in rewritten files (#4903).
[  348s]     
[  348s]         pytest would crash with:
[  348s]     
[  348s]                 fp.write(struct.pack("<ll", mtime, size))
[  348s]             E   struct.error: argument out of range
[  348s]         """
[  348s]         p = testdir.makepyfile(
[  348s]             """
[  348s]             def test(): pass
[  348s]         """
[  348s]         )
[  348s]         # use unsigned long timestamp which overflows signed long,
[  348s]         # which was the cause of the bug
[  348s]         # +1 offset also tests masking of 0xFFFFFFFF
[  348s]         timestamp = 2 ** 32 + offset
[  348s] >       os.utime(str(p), (timestamp, timestamp))
[  348s] E       OverflowError: Python int too large to convert to C long
[  348s] 
[  348s] /home/abuild/rpmbuild/BUILD/pytest-4.4.0/testing/test_assertrewrite.py:1253: OverflowError
[  348s] ________________________ test_source_mtime_long_long[1] ________________________
[  348s] 
[  348s] testdir = <Testdir local('/tmp/pytest-of-abuild/pytest-0/test_source_mtime_long_long1')>
[  348s] offset = 1
[  348s] 
[  348s]     @pytest.mark.parametrize("offset", [-1, +1])
[  348s]     def test_source_mtime_long_long(testdir, offset):
[  348s]         """Support modification dates after 2038 in rewritten files (#4903).
[  348s]     
[  348s]         pytest would crash with:
[  348s]     
[  348s]                 fp.write(struct.pack("<ll", mtime, size))
[  348s]             E   struct.error: argument out of range
[  348s]         """
[  348s]         p = testdir.makepyfile(
[  348s]             """
[  348s]             def test(): pass
[  348s]         """
[  348s]         )
[  348s]         # use unsigned long timestamp which overflows signed long,
[  348s]         # which was the cause of the bug
[  348s]         # +1 offset also tests masking of 0xFFFFFFFF
[  348s]         timestamp = 2 ** 32 + offset
[  348s] >       os.utime(str(p), (timestamp, timestamp))
[  348s] E       OverflowError: Python int too large to convert to C long
[  348s] 
[  348s] /home/abuild/rpmbuild/BUILD/pytest-4.4.0/testing/test_assertrewrite.py:1253: OverflowError
[  348s] >       os.utime(str(p), (timestamp, timestamp))
[  348s] E       OverflowError: Python int too large to convert to C long
[  348s] 
[  348s] /home/abuild/rpmbuild/BUILD/pytest-4.4.0/testing/test_assertrewrite.py:1253: OverflowError
[  348s] ________________________ test_source_mtime_long_long[1] ________________________
[  348s] 
[  348s] testdir = <Testdir local('/tmp/pytest-of-abuild/pytest-0/test_source_mtime_long_long1')>
[  348s] offset = 1
[  348s] 
[  348s]     @pytest.mark.parametrize("offset", [-1, +1])
[  348s]     def test_source_mtime_long_long(testdir, offset):
[  348s]         """Support modification dates after 2038 in rewritten files (#4903).
[  348s]     
[  348s]         pytest would crash with:
[  348s]     
[  348s]                 fp.write(struct.pack("<ll", mtime, size))
[  348s]             E   struct.error: argument out of range
[  348s]         """
[  348s]         p = testdir.makepyfile(
[  348s]             """
[  348s]             def test(): pass
[  348s]         """
[  348s]         )
[  348s]         # use unsigned long timestamp which overflows signed long,
[  348s]         # which was the cause of the bug
[  348s]         # +1 offset also tests masking of 0xFFFFFFFF
[  348s]         timestamp = 2 ** 32 + offset
[  348s] >       os.utime(str(p), (timestamp, timestamp))
[  348s] E       OverflowError: Python int too large to convert to C long
[  348s] 
[  348s] /home/abuild/rpmbuild/BUILD/pytest-4.4.0/testing/test_assertrewrite.py:1253: OverflowError
@Zac-HD
Copy link
Member

Zac-HD commented Apr 7, 2019

What version of Python does this occur on? If Python2, I suspect that this is simply not fixable for 32-bit operating systems (though we can add a skipif marker to the test).

@Zac-HD Zac-HD added the status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity label Apr 7, 2019
@thmo
Copy link

thmo commented Apr 16, 2019

Same issue with platform linux2 -- Python 2.7.16, pytest-4.4.1, py-1.8.0, pluggy-0.9.0 on i686.

@Zac-HD
Copy link
Member

Zac-HD commented Oct 24, 2019

Closed by #5045.

@Zac-HD Zac-HD closed this as completed Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity
Projects
None yet
Development

No branches or pull requests

3 participants