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

Tests fails in year 2038 #318

Open
bmwiedemann opened this issue Jul 31, 2023 · 0 comments
Open

Tests fails in year 2038 #318

bmwiedemann opened this issue Jul 31, 2023 · 0 comments

Comments

@bmwiedemann
Copy link

While working on reproducible builds for openSUSE, I found that
our python-django-graphql-jwt 0.3.4 package fails to build in 2038, because several tests fail.

To reproduce:

osc checkout openSUSE:Factory/python-django-graphql-jwt && cd $_
osc build --vm-type=kvm --noservice --clean --build-opt=--vm-custom-opt="-rtc base=2038-01-19T06:00:00" standard

log:

[...]
 _____________________ CookieTokenAuthTests.test_token_auth _____________________
 
 self = <tests.refresh_token.test_relay.CookieTokenAuthTests testMethod=test_token_auth>
 
     @override_jwt_settings(JWT_LONG_RUNNING_REFRESH_TOKEN=True)
     def test_token_auth(self):
         with catch_signal(token_issued) as token_issued_handler:
             response = self.execute(
                 {
                     self.user.USERNAME_FIELD: self.user.get_username(),
                     "password": "dolphins",
                 }
             )
     
         data = response.data["tokenAuth"]
         token = response.cookies.get(
             jwt_settings.JWT_REFRESH_TOKEN_COOKIE_NAME,
         ).value
     
         self.assertEqual(token_issued_handler.call_count, 1)
     
 >       self.assertIsNone(response.errors)
 E       AssertionError: [{'message': 'Int cannot represent non 32-bit signed integer value: 2148098416.0', 'locations': [{'line': 7, 'column': 9}], 'path': ['tokenAuth', 'refreshExpiresIn']}] is not None
 
 tests/refresh_token/mixins.py:159: AssertionError
 ____________________ CookieRefreshTests.test_refresh_token _____________________
 
 self = <tests.refresh_token.test_relay.CookieRefreshTests testMethod=test_refresh_token>
 
     def test_refresh_token(self):
         self.set_refresh_token_cookie()
     
         with catch_signal(
             refresh_token_rotated
         ) as refresh_token_rotated_handler, back_to_the_future(seconds=1):
     
             response = self.execute()
     
         data = response.data["refreshToken"]
 >       token = data["token"]
 E       TypeError: 'NoneType' object is not subscriptable
 
 tests/refresh_token/mixins.py:175: TypeError
 =============================== warnings summary ===============================
 ../../../../../usr/lib/python3.9/site-packages/django/conf/__init__.py:241
   /usr/lib/python3.9/site-packages/django/conf/__init__.py:241: RemovedInDjango50Warning: The default value of USE_TZ will change from False to True in Django 5.0. Set USE_TZ to False in your project settings if you want to keep the current default behavior.
     warnings.warn(
 
 -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
 =========================== short test summary info ============================
 FAILED tests/test_mutations.py::TokenAuthTests::test_token_auth - AssertionEr...
 FAILED tests/test_mutations.py::RefreshTests::test_refresh - TypeError: 'None...
 FAILED tests/test_mutations.py::CookieTokenAuthTests::test_token_auth - Asser...
 FAILED tests/test_mutations.py::CookieRefreshTests::test_refresh - TypeError:...
 FAILED tests/test_relay.py::TokenAuthTests::test_token_auth - AssertionError:...
 FAILED tests/test_relay.py::RefreshTests::test_refresh - TypeError: 'NoneType...
 FAILED tests/test_relay.py::CookieTokenAuthTests::test_token_auth - Assertion...
 FAILED tests/test_relay.py::CookieRefreshTests::test_refresh - TypeError: 'No...
 FAILED tests/refresh_token/test_mutations.py::TokenAuthTests::test_token_auth
 FAILED tests/refresh_token/test_mutations.py::RefreshTests::test_refresh_token
 FAILED tests/refresh_token/test_mutations.py::RefreshTests::test_reuse_refresh_token
 FAILED tests/refresh_token/test_mutations.py::CookieTokenAuthTests::test_token_auth
 FAILED tests/refresh_token/test_mutations.py::CookieRefreshTests::test_refresh_token
 FAILED tests/refresh_token/test_relay.py::TokenAuthTests::test_token_auth - T...
 FAILED tests/refresh_token/test_relay.py::RefreshTokenTests::test_refresh_token
 FAILED tests/refresh_token/test_relay.py::RefreshTokenTests::test_reuse_refresh_token
 FAILED tests/refresh_token/test_relay.py::CookieTokenAuthTests::test_token_auth
 FAILED tests/refresh_token/test_relay.py::CookieRefreshTests::test_refresh_token
 =========== 18 failed, 94 passed, 1 deselected, 1 warning in 10.80s ============
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