jazzband / django-oauth-toolkit

OAuth2 goodies for the Djangonauts!
https://django-oauth-toolkit.readthedocs.io
Other
3.06k stars 777 forks source link

Race conditions in tests with xdist on high core machine #1300

Open SuperSandro2000 opened 11 months ago

SuperSandro2000 commented 11 months ago

Describe the bug

When running the tests on a high core machine, race conditions can occur like:

Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing setuptools-build-hook
Using setuptoolsBuildPhase
Using setuptoolsShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing setuptools-check-hook
Using setuptoolsCheckPhase
Sourcing pytest-check-hook
Using pytestCheckPhase
Removing setuptoolsCheckPhase
unpacking sources
unpacking source archive /nix/store/sc9w3pf6q8njhh4w54aigs3jxk4qf5bv-source
source root is source
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/tox.ini
patching sources
updateAutotoolsGnuConfigScriptsPhase
configuring
no configure script, doing nothing
building
Executing setuptoolsBuildPhase
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/oauth2_provider
copying oauth2_provider/signals.py -> build/lib/oauth2_provider
copying oauth2_provider/models.py -> build/lib/oauth2_provider
copying oauth2_provider/__init__.py -> build/lib/oauth2_provider
copying oauth2_provider/http.py -> build/lib/oauth2_provider
copying oauth2_provider/apps.py -> build/lib/oauth2_provider
copying oauth2_provider/decorators.py -> build/lib/oauth2_provider
copying oauth2_provider/settings.py -> build/lib/oauth2_provider
copying oauth2_provider/generators.py -> build/lib/oauth2_provider
copying oauth2_provider/exceptions.py -> build/lib/oauth2_provider
copying oauth2_provider/forms.py -> build/lib/oauth2_provider
copying oauth2_provider/oauth2_backends.py -> build/lib/oauth2_provider
copying oauth2_provider/urls.py -> build/lib/oauth2_provider
copying oauth2_provider/oauth2_validators.py -> build/lib/oauth2_provider
copying oauth2_provider/scopes.py -> build/lib/oauth2_provider
copying oauth2_provider/admin.py -> build/lib/oauth2_provider
copying oauth2_provider/backends.py -> build/lib/oauth2_provider
copying oauth2_provider/compat.py -> build/lib/oauth2_provider
copying oauth2_provider/middleware.py -> build/lib/oauth2_provider
copying oauth2_provider/validators.py -> build/lib/oauth2_provider
creating build/lib/oauth2_provider/management
copying oauth2_provider/management/__init__.py -> build/lib/oauth2_provider/management
creating build/lib/oauth2_provider/contrib
copying oauth2_provider/contrib/__init__.py -> build/lib/oauth2_provider/contrib
creating build/lib/oauth2_provider/views
copying oauth2_provider/views/application.py -> build/lib/oauth2_provider/views
copying oauth2_provider/views/mixins.py -> build/lib/oauth2_provider/views
copying oauth2_provider/views/generic.py -> build/lib/oauth2_provider/views
copying oauth2_provider/views/base.py -> build/lib/oauth2_provider/views
copying oauth2_provider/views/token.py -> build/lib/oauth2_provider/views
copying oauth2_provider/views/introspect.py -> build/lib/oauth2_provider/views
copying oauth2_provider/views/oidc.py -> build/lib/oauth2_provider/views
copying oauth2_provider/views/__init__.py -> build/lib/oauth2_provider/views
creating build/lib/oauth2_provider/migrations
copying oauth2_provider/migrations/0003_auto_20201211_1314.py -> build/lib/oauth2_provider/migrations
copying oauth2_provider/migrations/0007_application_post_logout_redirect_uris.py -> build/lib/oauth2_provider/migrations
copying oauth2_provider/migrations/0005_auto_20211222_2352.py -> build/lib/oauth2_provider/migrations
copying oauth2_provider/migrations/0001_initial.py -> build/lib/oauth2_provider/migrations
copying oauth2_provider/migrations/0004_auto_20200902_2022.py -> build/lib/oauth2_provider/migrations
copying oauth2_provider/migrations/__init__.py -> build/lib/oauth2_provider/migrations
copying oauth2_provider/migrations/0006_alter_application_client_secret.py -> build/lib/oauth2_provider/migrations
copying oauth2_provider/migrations/0002_auto_20190406_1805.py -> build/lib/oauth2_provider/migrations
creating build/lib/oauth2_provider/management/commands
copying oauth2_provider/management/commands/createapplication.py -> build/lib/oauth2_provider/management/commands
copying oauth2_provider/management/commands/__init__.py -> build/lib/oauth2_provider/management/commands
copying oauth2_provider/management/commands/cleartokens.py -> build/lib/oauth2_provider/management/commands
creating build/lib/oauth2_provider/contrib/rest_framework
copying oauth2_provider/contrib/rest_framework/permissions.py -> build/lib/oauth2_provider/contrib/rest_framework
copying oauth2_provider/contrib/rest_framework/__init__.py -> build/lib/oauth2_provider/contrib/rest_framework
copying oauth2_provider/contrib/rest_framework/authentication.py -> build/lib/oauth2_provider/contrib/rest_framework
running egg_info
creating django_oauth_toolkit.egg-info
writing django_oauth_toolkit.egg-info/PKG-INFO
writing dependency_links to django_oauth_toolkit.egg-info/dependency_links.txt
writing requirements to django_oauth_toolkit.egg-info/requires.txt
writing top-level names to django_oauth_toolkit.egg-info/top_level.txt
writing manifest file 'django_oauth_toolkit.egg-info/SOURCES.txt'
reading manifest file 'django_oauth_toolkit.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
adding license file 'AUTHORS'
writing manifest file 'django_oauth_toolkit.egg-info/SOURCES.txt'
/nix/store/w453w4jw22kf20x0yv8dg08p4gima8mv-python3.10-setuptools-67.4.0/lib/python3.10/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'oauth2_provider.templates.oauth2_provider' as data is deprecated, please list it in `packages`.
    !!

    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'oauth2_provider.templates.oauth2_provider' as an importable package,
    but it is not listed in the `packages` configuration of setuptools.

    'oauth2_provider.templates.oauth2_provider' has been automatically added to the distribution only
    because it may contain data files, but this behavior is likely to change
    in future versions of setuptools (and therefore is considered deprecated).

    Please make sure that 'oauth2_provider.templates.oauth2_provider' is included as a package by using
    the `packages` configuration field or the proper discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" and "data files" on setuptools
    documentation page.

!!

  check.warn(importable)
creating build/lib/oauth2_provider/templates
creating build/lib/oauth2_provider/templates/oauth2_provider
copying oauth2_provider/templates/oauth2_provider/application_confirm_delete.html -> build/lib/oauth2_provider/templates/oauth2_provider
copying oauth2_provider/templates/oauth2_provider/application_detail.html -> build/lib/oauth2_provider/templates/oauth2_provider
copying oauth2_provider/templates/oauth2_provider/application_form.html -> build/lib/oauth2_provider/templates/oauth2_provider
copying oauth2_provider/templates/oauth2_provider/application_list.html -> build/lib/oauth2_provider/templates/oauth2_provider
copying oauth2_provider/templates/oauth2_provider/application_registration_form.html -> build/lib/oauth2_provider/templates/oauth2_provider
copying oauth2_provider/templates/oauth2_provider/authorize.html -> build/lib/oauth2_provider/templates/oauth2_provider
copying oauth2_provider/templates/oauth2_provider/authorized-token-delete.html -> build/lib/oauth2_provider/templates/oauth2_provider
copying oauth2_provider/templates/oauth2_provider/authorized-tokens.html -> build/lib/oauth2_provider/templates/oauth2_provider
copying oauth2_provider/templates/oauth2_provider/base.html -> build/lib/oauth2_provider/templates/oauth2_provider
copying oauth2_provider/templates/oauth2_provider/logout_confirm.html -> build/lib/oauth2_provider/templates/oauth2_provider
/nix/store/w453w4jw22kf20x0yv8dg08p4gima8mv-python3.10-setuptools-67.4.0/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/forms.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/__init__.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
creating build/bdist.linux-x86_64/wheel/oauth2_provider/templates
creating build/bdist.linux-x86_64/wheel/oauth2_provider/templates/oauth2_provider
copying build/lib/oauth2_provider/templates/oauth2_provider/application_registration_form.html -> build/bdist.linux-x86_64/wheel/oauth2_provider/templates/oauth2_provider
copying build/lib/oauth2_provider/templates/oauth2_provider/application_form.html -> build/bdist.linux-x86_64/wheel/oauth2_provider/templates/oauth2_provider
copying build/lib/oauth2_provider/templates/oauth2_provider/authorize.html -> build/bdist.linux-x86_64/wheel/oauth2_provider/templates/oauth2_provider
copying build/lib/oauth2_provider/templates/oauth2_provider/base.html -> build/bdist.linux-x86_64/wheel/oauth2_provider/templates/oauth2_provider
copying build/lib/oauth2_provider/templates/oauth2_provider/authorized-token-delete.html -> build/bdist.linux-x86_64/wheel/oauth2_provider/templates/oauth2_provider
copying build/lib/oauth2_provider/templates/oauth2_provider/logout_confirm.html -> build/bdist.linux-x86_64/wheel/oauth2_provider/templates/oauth2_provider
copying build/lib/oauth2_provider/templates/oauth2_provider/application_list.html -> build/bdist.linux-x86_64/wheel/oauth2_provider/templates/oauth2_provider
copying build/lib/oauth2_provider/templates/oauth2_provider/authorized-tokens.html -> build/bdist.linux-x86_64/wheel/oauth2_provider/templates/oauth2_provider
copying build/lib/oauth2_provider/templates/oauth2_provider/application_detail.html -> build/bdist.linux-x86_64/wheel/oauth2_provider/templates/oauth2_provider
copying build/lib/oauth2_provider/templates/oauth2_provider/application_confirm_delete.html -> build/bdist.linux-x86_64/wheel/oauth2_provider/templates/oauth2_provider
copying build/lib/oauth2_provider/http.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/models.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
creating build/bdist.linux-x86_64/wheel/oauth2_provider/migrations
copying build/lib/oauth2_provider/migrations/0001_initial.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/migrations
copying build/lib/oauth2_provider/migrations/0003_auto_20201211_1314.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/migrations
copying build/lib/oauth2_provider/migrations/__init__.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/migrations
copying build/lib/oauth2_provider/migrations/0004_auto_20200902_2022.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/migrations
copying build/lib/oauth2_provider/migrations/0006_alter_application_client_secret.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/migrations
copying build/lib/oauth2_provider/migrations/0005_auto_20211222_2352.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/migrations
copying build/lib/oauth2_provider/migrations/0007_application_post_logout_redirect_uris.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/migrations
copying build/lib/oauth2_provider/migrations/0002_auto_20190406_1805.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/migrations
copying build/lib/oauth2_provider/decorators.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/oauth2_validators.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/settings.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/generators.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/apps.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/exceptions.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
creating build/bdist.linux-x86_64/wheel/oauth2_provider/contrib
creating build/bdist.linux-x86_64/wheel/oauth2_provider/contrib/rest_framework
copying build/lib/oauth2_provider/contrib/rest_framework/permissions.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/contrib/rest_framework
copying build/lib/oauth2_provider/contrib/rest_framework/__init__.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/contrib/rest_framework
copying build/lib/oauth2_provider/contrib/rest_framework/authentication.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/contrib/rest_framework
copying build/lib/oauth2_provider/contrib/__init__.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/contrib
copying build/lib/oauth2_provider/urls.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/admin.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/compat.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/oauth2_backends.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/signals.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/backends.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/middleware.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
creating build/bdist.linux-x86_64/wheel/oauth2_provider/views
copying build/lib/oauth2_provider/views/base.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/views
copying build/lib/oauth2_provider/views/application.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/views
copying build/lib/oauth2_provider/views/__init__.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/views
copying build/lib/oauth2_provider/views/token.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/views
copying build/lib/oauth2_provider/views/introspect.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/views
copying build/lib/oauth2_provider/views/generic.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/views
copying build/lib/oauth2_provider/views/mixins.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/views
copying build/lib/oauth2_provider/views/oidc.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/views
copying build/lib/oauth2_provider/scopes.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
copying build/lib/oauth2_provider/validators.py -> build/bdist.linux-x86_64/wheel/oauth2_provider
creating build/bdist.linux-x86_64/wheel/oauth2_provider/management
copying build/lib/oauth2_provider/management/__init__.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/management
creating build/bdist.linux-x86_64/wheel/oauth2_provider/management/commands
copying build/lib/oauth2_provider/management/commands/__init__.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/management/commands
copying build/lib/oauth2_provider/management/commands/createapplication.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/management/commands
copying build/lib/oauth2_provider/management/commands/cleartokens.py -> build/bdist.linux-x86_64/wheel/oauth2_provider/management/commands
running install_egg_info
Copying django_oauth_toolkit.egg-info to build/bdist.linux-x86_64/wheel/django_oauth_toolkit-2.3.0-py3.10.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/django_oauth_toolkit-2.3.0.dist-info/WHEEL
creating 'dist/django_oauth_toolkit-2.3.0-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'oauth2_provider/__init__.py'
adding 'oauth2_provider/admin.py'
adding 'oauth2_provider/apps.py'
adding 'oauth2_provider/backends.py'
adding 'oauth2_provider/compat.py'
adding 'oauth2_provider/decorators.py'
adding 'oauth2_provider/exceptions.py'
adding 'oauth2_provider/forms.py'
adding 'oauth2_provider/generators.py'
adding 'oauth2_provider/http.py'
adding 'oauth2_provider/middleware.py'
adding 'oauth2_provider/models.py'
adding 'oauth2_provider/oauth2_backends.py'
adding 'oauth2_provider/oauth2_validators.py'
adding 'oauth2_provider/scopes.py'
adding 'oauth2_provider/settings.py'
adding 'oauth2_provider/signals.py'
adding 'oauth2_provider/urls.py'
adding 'oauth2_provider/validators.py'
adding 'oauth2_provider/contrib/__init__.py'
adding 'oauth2_provider/contrib/rest_framework/__init__.py'
adding 'oauth2_provider/contrib/rest_framework/authentication.py'
adding 'oauth2_provider/contrib/rest_framework/permissions.py'
adding 'oauth2_provider/management/__init__.py'
adding 'oauth2_provider/management/commands/__init__.py'
adding 'oauth2_provider/management/commands/cleartokens.py'
adding 'oauth2_provider/management/commands/createapplication.py'
adding 'oauth2_provider/migrations/0001_initial.py'
adding 'oauth2_provider/migrations/0002_auto_20190406_1805.py'
adding 'oauth2_provider/migrations/0003_auto_20201211_1314.py'
adding 'oauth2_provider/migrations/0004_auto_20200902_2022.py'
adding 'oauth2_provider/migrations/0005_auto_20211222_2352.py'
adding 'oauth2_provider/migrations/0006_alter_application_client_secret.py'
adding 'oauth2_provider/migrations/0007_application_post_logout_redirect_uris.py'
adding 'oauth2_provider/migrations/__init__.py'
adding 'oauth2_provider/templates/oauth2_provider/application_confirm_delete.html'
adding 'oauth2_provider/templates/oauth2_provider/application_detail.html'
adding 'oauth2_provider/templates/oauth2_provider/application_form.html'
adding 'oauth2_provider/templates/oauth2_provider/application_list.html'
adding 'oauth2_provider/templates/oauth2_provider/application_registration_form.html'
adding 'oauth2_provider/templates/oauth2_provider/authorize.html'
adding 'oauth2_provider/templates/oauth2_provider/authorized-token-delete.html'
adding 'oauth2_provider/templates/oauth2_provider/authorized-tokens.html'
adding 'oauth2_provider/templates/oauth2_provider/base.html'
adding 'oauth2_provider/templates/oauth2_provider/logout_confirm.html'
adding 'oauth2_provider/views/__init__.py'
adding 'oauth2_provider/views/application.py'
adding 'oauth2_provider/views/base.py'
adding 'oauth2_provider/views/generic.py'
adding 'oauth2_provider/views/introspect.py'
adding 'oauth2_provider/views/mixins.py'
adding 'oauth2_provider/views/oidc.py'
adding 'oauth2_provider/views/token.py'
adding 'django_oauth_toolkit-2.3.0.dist-info/AUTHORS'
adding 'django_oauth_toolkit-2.3.0.dist-info/LICENSE'
adding 'django_oauth_toolkit-2.3.0.dist-info/METADATA'
adding 'django_oauth_toolkit-2.3.0.dist-info/WHEEL'
adding 'django_oauth_toolkit-2.3.0.dist-info/top_level.txt'
adding 'django_oauth_toolkit-2.3.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
/build/source/dist /build/source
Unpacking to: unpacked/django_oauth_toolkit-2.3.0...OK
Repacking wheel as ./django_oauth_toolkit-2.3.0-py3-none-any.whl...OK
/build/source
Finished executing setuptoolsBuildPhase
installing
Executing pipInstallPhase
/build/source/dist /build/source
Processing ./django_oauth_toolkit-2.3.0-py3-none-any.whl
Requirement already satisfied: django in /nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages (from django-oauth-toolkit==2.3.0) (3.2.20)
Requirement already satisfied: oauthlib>=3.1.0 in /nix/store/sn145zd7y7z62ry2y5gx7gl9q5w77ls4-python3.10-oauthlib-3.2.2/lib/python3.10/site-packages (from django-oauth-toolkit==2.3.0) (3.2.2)
Requirement already satisfied: requests>=2.13.0 in /nix/store/r28nia5cg3naw9n2z21n05wx71kpww01-python3.10-requests-2.31.0/lib/python3.10/site-packages (from django-oauth-toolkit==2.3.0) (2.31.0)
Requirement already satisfied: jwcrypto>=0.8.0 in /nix/store/6mb0n46xfvy8zhhygjs46jypj0zysa50-python3.10-jwcrypto-1.5.0/lib/python3.10/site-packages (from django-oauth-toolkit==2.3.0) (1.5.0)
Requirement already satisfied: cryptography>=3.4 in /nix/store/8ln7i0lj1nlyvz92xlpazkqafbhdn4km-python3.10-cryptography-41.0.1/lib/python3.10/site-packages (from jwcrypto>=0.8.0->django-oauth-toolkit==2.3.0) (41.0.1)
Requirement already satisfied: deprecated in /nix/store/4zyxpja30j4r5pj42p62ci0202dkpmls-python3.10-deprecated-1.2.13/lib/python3.10/site-packages (from jwcrypto>=0.8.0->django-oauth-toolkit==2.3.0) (1.2.13)
Requirement already satisfied: certifi>=2017.4.17 in /nix/store/9nc6sb8z6qb1gk57k9bj1sx44ga98zn8-python3.10-certifi-2023.05.07/lib/python3.10/site-packages (from requests>=2.13.0->django-oauth-toolkit==2.3.0) (2023.5.7)
Requirement already satisfied: idna<4,>=2.5 in /nix/store/x70sxi4vqnxi38i9njvbjy36z6r3h6aa-python3.10-idna-3.4/lib/python3.10/site-packages (from requests>=2.13.0->django-oauth-toolkit==2.3.0) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /nix/store/bn587rkhix549fwg83343gb41179hrc3-python3.10-urllib3-1.26.14/lib/python3.10/site-packages (from requests>=2.13.0->django-oauth-toolkit==2.3.0) (1.26.14)
Requirement already satisfied: charset-normalizer<4,>=2 in /nix/store/x95p5bb2j3lc4fky4m9aa8dhx6777h3m-python3.10-charset-normalizer-3.0.1/lib/python3.10/site-packages (from requests>=2.13.0->django-oauth-toolkit==2.3.0) (3.0.1)
Requirement already satisfied: sqlparse>=0.2.2 in /nix/store/s9lxbp0q64gqnx752b0g6ngxag7lha85-python3.10-sqlparse-0.4.4/lib/python3.10/site-packages (from django->django-oauth-toolkit==2.3.0) (0.4.4)
Requirement already satisfied: asgiref<4,>=3.3.2 in /nix/store/c08gw3vy0iyvad9a2jmvcm8a3dph3kp8-python3.10-asgiref-3.7.2/lib/python3.10/site-packages (from django->django-oauth-toolkit==2.3.0) (3.7.2)
Requirement already satisfied: pytz in /nix/store/8s1yb2di3734jy31lyj336lpllfabi53-python3.10-pytz-2023.3/lib/python3.10/site-packages (from django->django-oauth-toolkit==2.3.0) (2023.3)
Requirement already satisfied: typing-extensions>=4 in /nix/store/1bg2qy3ab113cxfk0klk96n561ya13zc-python3.10-typing-extensions-4.5.0/lib/python3.10/site-packages (from asgiref<4,>=3.3.2->django->django-oauth-toolkit==2.3.0) (4.5.0)
Requirement already satisfied: cffi>=1.12 in /nix/store/2jz26gpysf7yxk938g9l86nh32ll8cjv-python3.10-cffi-1.15.1/lib/python3.10/site-packages (from cryptography>=3.4->jwcrypto>=0.8.0->django-oauth-toolkit==2.3.0) (1.15.1)
Requirement already satisfied: wrapt<2,>=1.10 in /nix/store/ckf2j0wgshgh54a4lfly1hl9mrfj8wn0-python3.10-wrapt-1.14.1/lib/python3.10/site-packages (from deprecated->jwcrypto>=0.8.0->django-oauth-toolkit==2.3.0) (1.14.1)
Requirement already satisfied: pycparser in /nix/store/vczvk2zwf4v6fg3v332qsvavpmsfjpc7-python3.10-pycparser-2.21/lib/python3.10/site-packages (from cffi>=1.12->cryptography>=3.4->jwcrypto>=0.8.0->django-oauth-toolkit==2.3.0) (2.21)
Installing collected packages: django-oauth-toolkit
Successfully installed django-oauth-toolkit-2.3.0
/build/source
Finished executing pipInstallPhase
pythonOutputDistPhase
Executing pythonOutputDistPhase
Finished executing pythonOutputDistPhase
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/8i2f1y1b4y11h0ysai5jzz6pwvs6vqr9-python3.10-django-oauth-toolkit-2.3.0
checking for references to /build/ in /nix/store/8i2f1y1b4y11h0ysai5jzz6pwvs6vqr9-python3.10-django-oauth-toolkit-2.3.0...
patching script interpreter paths in /nix/store/8i2f1y1b4y11h0ysai5jzz6pwvs6vqr9-python3.10-django-oauth-toolkit-2.3.0
stripping (with command strip and flags -S -p) in  /nix/store/8i2f1y1b4y11h0ysai5jzz6pwvs6vqr9-python3.10-django-oauth-toolkit-2.3.0/lib
shrinking RPATHs of ELF executables and libraries in /nix/store/bapphy12b8mgvj3k6bn49966rrj2mxw0-python3.10-django-oauth-toolkit-2.3.0-dist
checking for references to /build/ in /nix/store/bapphy12b8mgvj3k6bn49966rrj2mxw0-python3.10-django-oauth-toolkit-2.3.0-dist...
patching script interpreter paths in /nix/store/bapphy12b8mgvj3k6bn49966rrj2mxw0-python3.10-django-oauth-toolkit-2.3.0-dist
Executing pythonRemoveTestsDir
Finished executing pythonRemoveTestsDir
running install tests
no Makefile or custom installCheckPhase, doing nothing
pythonCatchConflictsPhase
pythonRemoveBinBytecodePhase
pythonImportsCheckPhase
Executing pythonImportsCheckPhase
pytestXdistHook
pytestCheckPhase
Executing pytestCheckPhase
============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-7.2.1, pluggy-1.2.0
django: settings: tests.settings (from env)
rootdir: /build/source, configfile: tox.ini
plugins: django-4.5.2, xdist-3.2.1, mock-3.10.0
gw0 [413] / gw1 [413] / gw2 [413] / gw3 [413] / gw4 [413] / gw5 [413] / gw6 [413] / gw7 [413] / gw8 [413] / gw9 [413] / gw10 [413] / gw11 [413] / gw12 [413] / gw13 [413] / gw14 [413] / gw15 [413] / gw16 [413] / gw17 [413] / gw18 [413] / gw19 [413] / gw20 [413] / gw21 [413] / gw22 [413] / gw23 [413] / gw24 [413] / gw25 [413] / gw26 [413] / gw27 [413] / gw28 [413] / gw29 [413] / gw30 [413] / gw31 [413] / gw32 [413] / gw33 [413] / gw34 [413] / gw35 [413] / gw36 [413] / gw37 [413] / gw38 [413] / gw39 [413] / gw40 [413] / gw41 [413] / gw42 [413] / gw43 [413] / gw44 [413] / gw45 [413] / gw46 [413] / gw47 [413] / gw48 [413] / gw49 [413] / gw50 [413] / gw51 [413] / gw52 [413] / gw53 [413] / gw54 [413] / gw55 [413] / gw56 [413] / gw57 [413] / gw58 [413] / gw59 [413] / gw60 [413] / gw61 [413] / gw62 [413] / gw63 [413] / gw64 [413] / gw65 [413] / gw66 [413] / gw67 [413] / gw68 [413] / gw69 [413] / gw70 [413] / gw71 [413] / gw72 [413] / gw73 [413] / gw74 [413] / gw75 [413] / gw76 [413] / gw77 [413] / gw78 [413] / gw79 [413] / gw80 [413] / gw81 [413] / gw82 [413] / gw83 [413] / gw84 [413] / gw85 [413] / gw86 [413] / gw87 [413] / gw88 [413] / gw89 [413] / gw90 [413] / gw91 [413] / gw92 [413] / gw93 [413] / gw94 [413] / gw95 [413]
==================================== ERRORS ====================================
__________________ ERROR at teardown of test_id_token_methods __________________
[gw44] linux -- Python 3.10.12 /nix/store/jhflvwr40xbb0xr6jx4311icp9cym1fp-python3-3.10.12/bin/python3.10

self = <pytest_django.fixtures._django_db_helper.<locals>.PytestDjangoTestCase testMethod=__init__>

    def _post_teardown(self):
        """
        Perform post-test things:
        * Flush the contents of the database to leave a clean slate. If the
          class has an 'available_apps' attribute, don't fire post_migrate.
        * Force-close the connection so the next test gets a clean cursor.
        """
        try:
>           self._fixture_teardown()

/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/test/testcases.py:1006: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/test/testcases.py:1248: in _fixture_teardown
    connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7ffff4ee1e10>
table_names = None

    def check_constraints(self, table_names=None):
        """
        Check each table name in `table_names` for rows with invalid foreign
        key references. This method is intended to be used in conjunction with
        `disable_constraint_checking()` and `enable_constraint_checking()`, to
        determine if rows with invalid references were entered while constraint
        checks were off.
        """
        if self.features.supports_pragma_foreign_key_check:
            with self.cursor() as cursor:
                if table_names is None:
                    violations = cursor.execute('PRAGMA foreign_key_check').fetchall()
                else:
                    violations = chain.from_iterable(
                        cursor.execute(
                            'PRAGMA foreign_key_check(%s)'
                            % self.ops.quote_name(table_name)
                        ).fetchall()
                        for table_name in table_names
                    )
                # See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
                for table_name, rowid, referenced_table_name, foreign_key_index in violations:
                    foreign_key = cursor.execute(
                        'PRAGMA foreign_key_list(%s)' % self.ops.quote_name(table_name)
                    ).fetchall()[foreign_key_index]
                    column_name, referenced_column_name = foreign_key[3:5]
                    primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
                    primary_key_value, bad_value = cursor.execute(
                        'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
                            self.ops.quote_name(primary_key_column_name),
                            self.ops.quote_name(column_name),
                            self.ops.quote_name(table_name),
                        ),
                        (rowid,),
                    ).fetchone()
>                   raise IntegrityError(
                        "The row in table '%s' with primary key '%s' has an "
                        "invalid foreign key: %s.%s contains a value '%s' that "
                        "does not have a corresponding value in %s.%s." % (
                            table_name, primary_key_value, table_name, column_name,
                            bad_value, referenced_table_name, referenced_column_name
                        )
                    )
E                   django.db.utils.IntegrityError: The row in table 'oauth2_provider_accesstoken' with primary key '1' has an invalid foreign key: oauth2_provider_accesstoken.id_token_id contains a value '1' that does not have a corresponding value in oauth2_provider_idtoken.id.

/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py:353: IntegrityError
------------------------------ Captured log setup ------------------------------
DEBUG    oauth2_provider.models:models.py:35 Test Application: client_secret is not hashed; hashing it now.
DEBUG    oauth2_provider:base.py:140 Success url for the request: http://example.org?code=cF9jdeSv4o3i0xHKjeEi4C1yE2pIQ6&state=random_state_string
=================================== FAILURES ===================================
_________ TestClearExpired.test_clear_expired_tokens_incorect_timetype _________
[gw46] linux -- Python 3.10.12 /nix/store/jhflvwr40xbb0xr6jx4311icp9cym1fp-python3-3.10.12/bin/python3.10

self = <tests.test_models.TestClearExpired testMethod=test_clear_expired_tokens_incorect_timetype>
result = <TestCaseFunction test_clear_expired_tokens_incorect_timetype>
debug = False

    def _setup_and_call(self, result, debug=False):
        """
        Perform the following in order: pre-setup, run test, post-teardown,
        skipping pre/post hooks if test is set to be skipped.

        If debug=True, reraise any errors in setup and use super().debug()
        instead of __call__() to run the test.
        """
        testMethod = getattr(self, self._testMethodName)
        skipped = (
            getattr(self.__class__, "__unittest_skip__", False) or
            getattr(testMethod, "__unittest_skip__", False)
        )

        # Convert async test methods.
        if asyncio.iscoroutinefunction(testMethod):
            setattr(self, self._testMethodName, async_to_sync(testMethod))

        if not skipped:
            try:
                self._pre_setup()
            except Exception:
                if debug:
                    raise
                result.addError(self, sys.exc_info())
                return
        if debug:
            super().debug()
        else:
            super().__call__(result)
        if not skipped:
            try:
>               self._post_teardown()

/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/test/testcases.py:284: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/test/testcases.py:1006: in _post_teardown
    self._fixture_teardown()
/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/test/testcases.py:1248: in _fixture_teardown
    connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7ffff4ee1e10>
table_names = None

    def check_constraints(self, table_names=None):
        """
        Check each table name in `table_names` for rows with invalid foreign
        key references. This method is intended to be used in conjunction with
        `disable_constraint_checking()` and `enable_constraint_checking()`, to
        determine if rows with invalid references were entered while constraint
        checks were off.
        """
        if self.features.supports_pragma_foreign_key_check:
            with self.cursor() as cursor:
                if table_names is None:
                    violations = cursor.execute('PRAGMA foreign_key_check').fetchall()
                else:
                    violations = chain.from_iterable(
                        cursor.execute(
                            'PRAGMA foreign_key_check(%s)'
                            % self.ops.quote_name(table_name)
                        ).fetchall()
                        for table_name in table_names
                    )
                # See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
                for table_name, rowid, referenced_table_name, foreign_key_index in violations:
                    foreign_key = cursor.execute(
                        'PRAGMA foreign_key_list(%s)' % self.ops.quote_name(table_name)
                    ).fetchall()[foreign_key_index]
                    column_name, referenced_column_name = foreign_key[3:5]
                    primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
                    primary_key_value, bad_value = cursor.execute(
                        'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
                            self.ops.quote_name(primary_key_column_name),
                            self.ops.quote_name(column_name),
                            self.ops.quote_name(table_name),
                        ),
                        (rowid,),
                    ).fetchone()
>                   raise IntegrityError(
                        "The row in table '%s' with primary key '%s' has an "
                        "invalid foreign key: %s.%s contains a value '%s' that "
                        "does not have a corresponding value in %s.%s." % (
                            table_name, primary_key_value, table_name, column_name,
                            bad_value, referenced_table_name, referenced_column_name
                        )
                    )
E                   django.db.utils.IntegrityError: The row in table 'oauth2_provider_application' with primary key '1' has an invalid foreign key: oauth2_provider_application.user_id contains a value '1' that does not have a corresponding value in auth_user.id.

/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py:353: IntegrityError
------------------------------ Captured log call -------------------------------
DEBUG    oauth2_provider.models:models.py:35 test_app: client_secret is not hashed; hashing it now.
____ TestOAuthLibCoreBackendErrorHandling.test_create_token_response_valid _____
[gw46] linux -- Python 3.10.12 /nix/store/jhflvwr40xbb0xr6jx4311icp9cym1fp-python3-3.10.12/bin/python3.10

self = <tests.test_oauth2_backends.TestOAuthLibCoreBackendErrorHandling testMethod=test_create_token_response_valid>
result = <TestCaseFunction test_create_token_response_valid>, debug = False

    def _setup_and_call(self, result, debug=False):
        """
        Perform the following in order: pre-setup, run test, post-teardown,
        skipping pre/post hooks if test is set to be skipped.

        If debug=True, reraise any errors in setup and use super().debug()
        instead of __call__() to run the test.
        """
        testMethod = getattr(self, self._testMethodName)
        skipped = (
            getattr(self.__class__, "__unittest_skip__", False) or
            getattr(testMethod, "__unittest_skip__", False)
        )

        # Convert async test methods.
        if asyncio.iscoroutinefunction(testMethod):
            setattr(self, self._testMethodName, async_to_sync(testMethod))

        if not skipped:
            try:
                self._pre_setup()
            except Exception:
                if debug:
                    raise
                result.addError(self, sys.exc_info())
                return
        if debug:
            super().debug()
        else:
            super().__call__(result)
        if not skipped:
            try:
>               self._post_teardown()

/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/test/testcases.py:284: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/test/testcases.py:1006: in _post_teardown
    self._fixture_teardown()
/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/test/testcases.py:1248: in _fixture_teardown
    connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7ffff4ee1e10>
table_names = None

    def check_constraints(self, table_names=None):
        """
        Check each table name in `table_names` for rows with invalid foreign
        key references. This method is intended to be used in conjunction with
        `disable_constraint_checking()` and `enable_constraint_checking()`, to
        determine if rows with invalid references were entered while constraint
        checks were off.
        """
        if self.features.supports_pragma_foreign_key_check:
            with self.cursor() as cursor:
                if table_names is None:
                    violations = cursor.execute('PRAGMA foreign_key_check').fetchall()
                else:
                    violations = chain.from_iterable(
                        cursor.execute(
                            'PRAGMA foreign_key_check(%s)'
                            % self.ops.quote_name(table_name)
                        ).fetchall()
                        for table_name in table_names
                    )
                # See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
                for table_name, rowid, referenced_table_name, foreign_key_index in violations:
                    foreign_key = cursor.execute(
                        'PRAGMA foreign_key_list(%s)' % self.ops.quote_name(table_name)
                    ).fetchall()[foreign_key_index]
                    column_name, referenced_column_name = foreign_key[3:5]
                    primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
                    primary_key_value, bad_value = cursor.execute(
                        'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
                            self.ops.quote_name(primary_key_column_name),
                            self.ops.quote_name(column_name),
                            self.ops.quote_name(table_name),
                        ),
                        (rowid,),
                    ).fetchone()
>                   raise IntegrityError(
                        "The row in table '%s' with primary key '%s' has an "
                        "invalid foreign key: %s.%s contains a value '%s' that "
                        "does not have a corresponding value in %s.%s." % (
                            table_name, primary_key_value, table_name, column_name,
                            bad_value, referenced_table_name, referenced_column_name
                        )
                    )
E                   django.db.utils.IntegrityError: The row in table 'oauth2_provider_accesstoken' with primary key '1' has an invalid foreign key: oauth2_provider_accesstoken.user_id contains a value '1' that does not have a corresponding value in auth_user.id.

/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py:353: IntegrityError
------------------------------ Captured log call -------------------------------
DEBUG    oauth2_provider.models:models.py:35 app: client_secret is not hashed; hashing it now.
DEBUG    oauth2_provider:oauth2_validators.py:203 Failed body authentication: Application 'john' does not exist
DEBUG    oauth2_provider:oauth2_validators.py:150 Failed basic auth: Application john does not exist
____ TestRevocationView.test_revoke_refresh_token_with_revoked_access_token ____
[gw45] linux -- Python 3.10.12 /nix/store/jhflvwr40xbb0xr6jx4311icp9cym1fp-python3-3.10.12/bin/python3.10

self = <tests.test_token_revocation.TestRevocationView testMethod=test_revoke_refresh_token_with_revoked_access_token>
result = <TestCaseFunction test_revoke_refresh_token_with_revoked_access_token>
debug = False

    def _setup_and_call(self, result, debug=False):
        """
        Perform the following in order: pre-setup, run test, post-teardown,
        skipping pre/post hooks if test is set to be skipped.

        If debug=True, reraise any errors in setup and use super().debug()
        instead of __call__() to run the test.
        """
        testMethod = getattr(self, self._testMethodName)
        skipped = (
            getattr(self.__class__, "__unittest_skip__", False) or
            getattr(testMethod, "__unittest_skip__", False)
        )

        # Convert async test methods.
        if asyncio.iscoroutinefunction(testMethod):
            setattr(self, self._testMethodName, async_to_sync(testMethod))

        if not skipped:
            try:
                self._pre_setup()
            except Exception:
                if debug:
                    raise
                result.addError(self, sys.exc_info())
                return
        if debug:
            super().debug()
        else:
            super().__call__(result)
        if not skipped:
            try:
>               self._post_teardown()

/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/test/testcases.py:284: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/test/testcases.py:1006: in _post_teardown
    self._fixture_teardown()
/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/test/testcases.py:1248: in _fixture_teardown
    connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7ffff4ee1e10>
table_names = None

    def check_constraints(self, table_names=None):
        """
        Check each table name in `table_names` for rows with invalid foreign
        key references. This method is intended to be used in conjunction with
        `disable_constraint_checking()` and `enable_constraint_checking()`, to
        determine if rows with invalid references were entered while constraint
        checks were off.
        """
        if self.features.supports_pragma_foreign_key_check:
            with self.cursor() as cursor:
                if table_names is None:
                    violations = cursor.execute('PRAGMA foreign_key_check').fetchall()
                else:
                    violations = chain.from_iterable(
                        cursor.execute(
                            'PRAGMA foreign_key_check(%s)'
                            % self.ops.quote_name(table_name)
                        ).fetchall()
                        for table_name in table_names
                    )
                # See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
                for table_name, rowid, referenced_table_name, foreign_key_index in violations:
                    foreign_key = cursor.execute(
                        'PRAGMA foreign_key_list(%s)' % self.ops.quote_name(table_name)
                    ).fetchall()[foreign_key_index]
                    column_name, referenced_column_name = foreign_key[3:5]
                    primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
                    primary_key_value, bad_value = cursor.execute(
                        'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
                            self.ops.quote_name(primary_key_column_name),
                            self.ops.quote_name(column_name),
                            self.ops.quote_name(table_name),
                        ),
                        (rowid,),
                    ).fetchone()
>                   raise IntegrityError(
                        "The row in table '%s' with primary key '%s' has an "
                        "invalid foreign key: %s.%s contains a value '%s' that "
                        "does not have a corresponding value in %s.%s." % (
                            table_name, primary_key_value, table_name, column_name,
                            bad_value, referenced_table_name, referenced_column_name
                        )
                    )
E                   django.db.utils.IntegrityError: The row in table 'oauth2_provider_refreshtoken' with primary key '1' has an invalid foreign key: oauth2_provider_refreshtoken.user_id contains a value '1' that does not have a corresponding value in auth_user.id.

/nix/store/fqjv4iwq95lbgp7q4040h024qbv6qq9r-python3.10-django-3.2.20/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py:353: IntegrityError
------------------------------ Captured log call -------------------------------
DEBUG    oauth2_provider.models:models.py:35 Test Application: client_secret is not hashed; hashing it now.
=============================== warnings summary ===============================
tests/test_client_credential.py:101: 96 warnings
  /build/source/tests/test_client_credential.py:101: PytestCollectionWarning: cannot collect test class 'TestView' because it has a __init__ constructor (from: tests/test_client_credential.py)
    class TestView(OAuthLibMixin, View):

tests/test_models.py::test_application_key
  /build/source/tests/test_models.py:509: DeprecationWarning: Call to deprecated function (or staticmethod) key_type.
    assert key.key_type == "RSA"

tests/test_models.py::test_application_key
  /build/source/tests/test_models.py:520: DeprecationWarning: Call to deprecated function (or staticmethod) key_type.
    assert key.key_type == "oct"

tests/test_authorization_code.py::TestOIDCAuthorizationCodeHSAlgorithm::test_id_token
  /build/source/tests/test_authorization_code.py:1674: DeprecationWarning: Call to deprecated function (or staticmethod) key_type.
    assert key.key_type == "oct"

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_models.py::TestClearExpired::test_clear_expired_tokens_incorect_timetype - django.db.utils.IntegrityError: The row in table 'oauth2_provider_applicati...
FAILED tests/test_oauth2_backends.py::TestOAuthLibCoreBackendErrorHandling::test_create_token_response_valid - django.db.utils.IntegrityError: The row in table 'oauth2_provider_accesstok...
FAILED tests/test_token_revocation.py::TestRevocationView::test_revoke_refresh_token_with_revoked_access_token - django.db.utils.IntegrityError: The row in table 'oauth2_provider_refreshto...
ERROR tests/test_models.py::test_id_token_methods - django.db.utils.IntegrityError: The row in table 'oauth2_provider_accesstok...
============= 3 failed, 410 passed, 99 warnings, 1 error in 9.98s ==============
/nix/store/7aprjn0yf6p06krg4087sxvilfp4c8yy-stdenv-linux/setup: line 1596: pop_var_context: head of shell_variables not a function context

To Reproduce Run tests on high core machine with xdist

Expected behavior It should just work :)

Version 2.3.0

Additional context

dopry commented 9 months ago

@SuperSandro2000, That's a bit overkill on the data dump. Can you provide step by step instructions to reproduce some of don't even know what xdist is... ala...

  1. pip install ...
  2. edit such and such file
  3. run python manage.py test

our tests are not guaranteed for high levels of parallelization, and many depend on db state and were written before extensive parallel testing. I would call this a feature requests since the test suite wasn't designed for parallel testing.

Are you up to refactoring the tests to support parallel testing with xdist?

SuperSandro2000 commented 8 months ago

That's a bit overkill on the data dump.

That's the complete build log which contains everything including the build log, what dependencies where found and the pytest build log. I mean I can omit it but describing all the information contained in it is not that productive.

Can you provide step by step instructions to reproduce some of don't even know what xdist is... ala...

Basically we build the package with the required dependencies, install the wheel and run pytest with pytest-django, the other required test dependencies. pytest-xdist is an official plugin of pytest which runs test in parallel, so that they run faster.

I think you are using a sharded database between all tests which means if they are run in parallel things break.

Are you up to refactoring the tests to support parallel testing with xdist?

no, I am just packaging things for nixos. 😓

dopry commented 8 months ago

Can you provide step by step instructions to reproduce some of don't even know what xdist is... ala...

Basically we build the package with the required dependencies, install the wheel and run pytest with pytest-django, the other required test dependencies. pytest-xdist is an official plugin of pytest which runs test in parallel, so that they run faster.

Can us something I can copy paste to do the same... ex)

git clone ...
python -m venv ./venv
pip install ....
# and other other steps so that we can reproduce

I think you are using a shared database between all tests which means if they are run in parallel things break.

I think you may be correct, and it may mean that our tests need extensive refactoring to work with pytest-xdist. We can't really start to dig into that until we have explicit directions to reproduce how you're running the distributed tests.

Are you up to refactoring the tests to support parallel testing with xdist?

no, I am just packaging things for nixos. 😓

Maybe someone will share your itch, If I were you I'd try to advocate to people in your OSS circles to help implement this if it would make your life easier. Getting clear instructions to run the tests as you want, is a good way to enable anyone who may want to take on this task.