58 Commits

Author SHA1 Message Date
Ran Benita
b78cf1c0ce Improve typing
Fix #1057
2024-04-15 23:30:17 +03:00
Ran Benita
024c73f29e testing: fix a private pytest import to its current location 2024-04-06 21:54:44 +03:00
Ran Benita
816c9dcda1 Use ruff instead of black, flake8, autoflake, pyupgrade
Config adapted from pytest.
2024-04-03 00:19:32 +03:00
Ran Benita
e3b69d4f29 Sort imports
Using pytest's style.
2024-04-03 00:19:31 +03:00
Bruno Oliveira
be1d5c401f Make collection progress output less verbose (#901)
Fix #555
2023-05-12 10:36:32 -03:00
Aleksandr Mezin
e9860923bf Fix some LoadScheduling tests
The expected number of nodes didn't match throughout the test code.
2023-01-11 22:34:56 +02:00
Aleksandr Mezin
d1dfad3e92 Implement work-stealing scheduler (#862)
Closes #858
2023-01-11 08:38:57 -03:00
Aleksandr Mezin
9b0b5b1495 Add --maxschedchunk CLI option (#857)
Maximum number of tests scheduled in one step.

Setting it to 1 will force pytest to send tests to workers one by one -
might be useful for a small number of slow tests.

Larger numbers will allow the scheduler to submit consecutive chunks of tests
to workers - allows reusing fixtures.

Unlimited if not set.

Fixes #855
Fixes #255
2022-12-23 08:21:20 -03:00
Aleksandr Mezin
80130d59ea Restore old initial batch distribution logic in LoadScheduling (#812)
* Restore old initial batch distribution logic in LoadScheduling

pytest orders tests for optimal sequential execution - i. e. avoiding
unnecessary setup and teardown of fixtures. So executing tests in consecutive
chunks is important for optimal performance.

Commit 09d79ace35 optimized test distribution for
the corner case, when the number of tests is less than 2 * number of nodes.
At the same time, it made initial test distribution worse for all other cases.
If some tests use some fixture, and these tests fit into the initial batch,
the fixture will be created min(n_tests, n_workers) times, no matter how many
other tests there are. With the old algorithm (before
09d79ace35), if there are enough tests not using
the fixture, the fixture was created only once.

So restore the old behavior for typical cases where the number of tests is
much greater than the number of workers (or, strictly speaking, when there
are at least 2 tests for every node).

In my test suite, where fixtures create Docker containers, this change reduces
total run time by 10-15%.

This is a partial revert of commit 09d79ace35

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-10-22 07:12:16 -03:00
Pepa
61132777f8 Added known limitation section to the docs (#796)
Co-authored-by: Josef <sorry.i-keep@it.private>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-07-22 10:44:17 -03:00
Ran Benita
9ddb274f23 Update test suite to modern pytest
- Use pytest>=6.2 features (same as install_requires).
  When we can require >=7, can fix some more typing omissions and
  version checks.
- Replace testdir with pytester
- Replace py.test with pytest
- Replace tmpdir with tmp_path
- Remove (almost) all other uses of py
- Add some type annotations (not checked yet)

Ref #722.
2021-11-01 09:05:28 +02:00
Hugo
22ae7ff7af Upgrade Python syntax with pyupgrade --py3-plus 2020-08-03 22:52:03 +10:00
Bruno Oliveira
bbc5416037 Use "nodes * 4" as default for --max-worker-restart
Fix #226
2019-06-06 19:53:37 -03:00
Bruno Oliveira
fced1645cb Run pre-commit: black, whitespaces, rst 2018-07-27 17:50:55 -03:00
feuillemorte
40491279ef #234 Added master/worker terminology 2018-01-17 23:07:29 +03:00
Hugo
c6f2fdcc31 Remove redundant parentheses 2017-12-21 11:19:58 +02:00
Carlos Jenkins
8356cfa39d Split schedulers into their own submodule. 2017-07-28 23:55:09 -06:00
Michael Elovskikh
4ed8161ef8 Renamed scheduller remove_item method to mark_test_complete 2017-02-15 23:54:23 +05:00
Michael Elovskikh
c809406ef6 Refactor scheduller interface, make more properties instead of methods 2017-02-15 11:43:56 +05:00
Michael Elovskikh
a99e6e7ca8 Clean up scheduller interfaces 2017-02-15 00:21:26 +05:00
Michael Elovskikh
6200123fac Made EachScheduling.numnodes countable from config 2017-02-14 20:19:55 +05:00
Michael Elovskikh
a2aaf9bf04 Rename init_distribute() to more clear schedule() 2017-02-14 20:19:55 +05:00
Michael Elovskikh
27ffbbb4f7 Unified scheduler class interface 2017-02-14 20:19:55 +05:00
Bruno Oliveira
7609e9376a Fix call to report_collection_diff in test
"from" and "to" of the diff algorithm expect strings only
2015-12-03 18:34:32 -02:00
Steven Hazel
09d79ace35 Do a better job parallelizing the inital batch of tests when the
number of nodes is more than half the number of tests. This makes it
possible, for example, to run all tests in parallel, where previous
the maximum parallelization was half of all tests.
2015-11-18 13:06:04 -08:00
Ronny Pfannschmidt
0f5ef95be8 flake8 cleanup 2015-09-01 22:37:51 +02:00
Bruno Oliveira
d84f1f08d8 fix issue 594: xdist is not executing tests parametrized with random values
Now xdist properly reports the collection errors instead of silently failing to execute
the test suite.
2014-09-23 22:09:44 -03:00
holger krekel
7a0cb35322 modernize tox.ini a bit and make another test dict-ordering independent 2014-09-18 19:40:48 +02:00
holger krekel
3a75b754d0 - add changelog entry for restart-crashed-nodes
- fix a test which depended on dict ordering
- minor test cleanups
2014-09-18 18:12:42 +02:00
Bruno Oliveira
9d549a0c06 Log different tests collected by slaves instead of an error
This is a proposal to fix #556.
2014-08-02 20:59:45 -03:00
holger krekel
cc237b0d8e fix various flakes issues and add "flakes" to tox tests 2014-07-20 16:56:21 +02:00
holger krekel
67f80b7c2c fix pytest issue503: avoid random re-setup of broad scoped fixtures
(anything above function).
2014-07-20 16:41:03 +02:00
holger krekel
e26d4486fc send multiple "to test" indices in one network message to a slave
and improve heuristics for sending chunks where the chunksize
depends on the number of remaining tests rather than fixed numbers.
This reduces the number of master -> node messages (but not the
reverse direction)
2014-01-27 11:37:40 +01:00
holger krekel
18a30fab7d fix issue419: work with collection indices instead of node ids.
This reduces network message size.
2014-01-27 11:37:33 +01:00
holger krekel
a22e0384a1 a failing test for pytest issue419 2014-01-27 11:37:26 +01:00
holger krekel
b88b23e358 some test fixes and configure tox-testing against pytest==2.3.5 and pytest>=2.4.2 2013-10-04 10:34:24 +02:00
Dmitrijs Milajevs
fa96143aeb Cleanup 2013-09-05 15:30:37 +02:00
Dmitrijs Milajevs
9a50d9de17 Give more context when nodes collected different tests. 2013-09-05 15:24:27 +02:00
holger krekel
1f6d410481 fix issue 93 of pytest - avoid delayed teardowns 2011-12-02 21:03:29 +00:00
holger krekel
eb09e22b62 fix test 2010-12-07 12:47:36 +01:00
holger krekel
fc1f29db68 * introduce progress-reporting
* rename somewhat internal pytest_gwmanage_* events to pytest_xdist_*
* make gateway setup a separate step
2010-11-22 15:39:56 +01:00
holger krekel
a0652e9d99 adapt to new import locations 2010-11-13 11:12:19 +01:00
holger krekel
d83af5fdcd adapt to shifted plugin names 2010-10-11 01:15:31 +02:00
holger krekel
025f1d577e adapt xdist plugin - it still uses some internal imports 2010-10-10 15:33:32 +02:00
holger krekel
9df55b1c60 refactor and port dsession tests, re-introduce --dist testing along
with a simple scheduler.
2010-09-28 16:32:42 +02:00
holger krekel
3767ce3269 move some code around, ending up with fewer files logically grouped 2010-09-28 16:08:31 +02:00
holger krekel
c90c4a254c make rsyncing work again, some streamlining in termination detection 2010-09-27 16:13:55 +02:00
holger krekel
2efb059d75 adapt to new refactored py baseline.
remove pickling in distributed testing
refactor internal mechanism enough to work for -n1
* * *
fix handling of crashing items and slave down events
2010-09-27 16:13:54 +02:00
holger krekel
4d0422a548 remove trailing whitespace from sources 2010-09-07 10:46:58 +02:00
holger krekel
f7be994848 adapt for py-trunk/1.3.1 changes wrt --exitfirst -> --maxfailures 2010-05-25 16:59:08 +02:00