jupyter-server / jupyter_server

The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications.
https://jupyter-server.readthedocs.io
BSD 3-Clause "New" or "Revised" License
484 stars 295 forks source link

Fix test param for pytest-xdist #1382

Closed tornaria closed 9 months ago

tornaria commented 9 months ago

Currently using pytest-xdist sometimes fails because of test_gateway_request_with_expiring_cookies which has a changing parameter: expire_param will be computed as 180 seconds in the future at file load time. But when using xdist each thread computes its own value for this parameter and it may happen that different threads have different parameters, which xdist doesn't support.

Here I change the test so the parameter is just 180, and the actual timestamp for the expiration argument is computed inside the test. With this single change, using pytest-xdist works fine.

welcome[bot] commented 9 months ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly. welcome You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] commented 9 months ago

Congrats on your first merged pull request in this project! :tada: congrats Thank you for contributing, we are very proud of you! :heart: