https://forge.softwareheritage.org/source/swh-scheduler.git
Revision 3aed7bf1cc114a874ecc86e87a2fb9df961b6773 authored by Antoine R. Dumont (@ardumont) on 15 October 2021, 13:14:12 UTC, committed by Antoine R. Dumont (@ardumont) on 15 October 2021, 13:22:52 UTC
This scenario happens with the loader oneshot for example. This loader deals with more
than 1 type of origins to ingest in the same queue. So the computation of that function
returned negative value [1]. Which is ultimately not possible to execute in sql [1].

This commits fixes that behavior. This also explicits that the function must return
positive values in its docstring.

[1]
```
...
psycopg2.errors.InvalidRowCountInLimitClause: LIMIT must not be negative
```
1 parent ecc1400
Raw File
Tip revision: 3aed7bf1cc114a874ecc86e87a2fb9df961b6773 authored by Antoine R. Dumont (@ardumont) on 15 October 2021, 13:14:12 UTC
Return 0 slot if no more slots available in the queues
Tip revision: 3aed7bf
conftest.py
# Copyright (C) 2020  The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information


from hypothesis import settings

# define tests profile. Full documentation is at:
# https://hypothesis.readthedocs.io/en/latest/settings.html#settings-profiles
settings.register_profile("fast", max_examples=5, deadline=5000)
settings.register_profile("slow", max_examples=20, deadline=5000)


pytest_plugins = ["swh.scheduler.pytest_plugin", "swh.core.db.pytest_plugin"]
back to top