Commit a94d63c5 authored by Kirill Smelkov's avatar Kirill Smelkov

racetest: Mark check_race_external_invalidate_vs_disconnect as long-running

And add a way to run tests without long tests:

	zope-testrunner --at-level=1

will run tests without those marked as being long.

By default tox continues to run all tests.

Suggested by @d-maurer with the idea to be able to skip long tests that
are unlikely to fail during development:

https://github.com/zopefoundation/ZODB/pull/368#discussion_r946386969
parent fc20f3aa
......@@ -14,6 +14,9 @@ with-sphinx-doctests = false
[tox]
use-flake8 = true
testenv-commands = [
"zope-testrunner --test-path=src --all {posargs:-vc}",
]
testenv-setenv = [
"ZOPE_INTERFACE_STRICT_IRO=1",
]
......
......@@ -45,7 +45,7 @@ import transaction
from ZODB import DB, POSException
from ZODB.utils import tid_repr, at2before
from ZODB.tests.MinPO import MinPO
from ZODB.tests.util import with_high_concurrency
from ZODB.tests.util import with_high_concurrency, long_test
import threading
from random import randint
......@@ -352,6 +352,7 @@ class RaceTests(object):
# state, or in new state after the next transaction. Contrary to that, with
# T2ObjectsInc2Phase the invariant will be detected to be broken on the
# next transaction.
@long_test
def check_race_external_invalidate_vs_disconnect(self):
return self._check_race_xxx_vs_external_disconnect(
T2ObjectsInc2Phase())
......
......@@ -113,6 +113,23 @@ class TestCase(unittest.TestCase):
tearDown = tearDown
# propagate .level from tested method to TestCase so that e.g. @long_test
# works
@property
def level(self):
f = getattr(self, self._testMethodName)
return getattr(f, 'level', 1)
def long_test(f):
"""
long_test decorates f to be marked as long-running test.
Use `zope-testrunner --at-level=1` to run tests without the long-ones.
"""
f.level = 2
return f
def pack(db):
db.pack(time.time()+1)
......
......@@ -23,7 +23,7 @@ deps =
setenv =
ZOPE_INTERFACE_STRICT_IRO=1
commands =
zope-testrunner --test-path=src {posargs:-vc}
zope-testrunner --test-path=src --all {posargs:-vc}
extras =
test
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment