From: Mike Bayer Date: Wed, 7 Oct 2020 03:48:47 +0000 (-0400) Subject: add --notimingintensive; block from github jobs X-Git-Tag: rel_1_4_0b1~52^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42b761aefb656636471da90c13aa1b9affcacea6;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add --notimingintensive; block from github jobs this provides a front-end option to disable tests marked as timing_intensive, all of which are in test_pool, which are more fragile and aren't consistent on the github runners. also remove /reduce unnecessary time.sleep() from two other pool tests that are not timing intensive. note that this removes test_hanging_connect_within_overflow from the github runs via the timing_intensive requirement. I've also removed MockReconnectTest from exclusions as those are really important tests and they use mocks so should not have platform dependent issues. Need to see what the windows failures are. Closes: #5633 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5633 Pull-request-sha: 166833e16ec342dfa10edb287d7aa495ddd1b59d Change-Id: Icb3d284a2a952e2495d80fa91e22e0b32a54340f --- diff --git a/.github/workflows/create-wheels.yaml b/.github/workflows/create-wheels.yaml index e94f97d3b9..8c2d7ee604 100644 --- a/.github/workflows/create-wheels.yaml +++ b/.github/workflows/create-wheels.yaml @@ -94,7 +94,7 @@ jobs: # the mock reconnect test seems to fail on the ci in windows run: | pip install pytest pytest-xdist ${{ matrix.extra-requires }} - pytest -n2 -q test -k 'not MockReconnectTest' --nomemory + pytest -n2 -q test --nomemory --notimingintensive - name: Get wheel name id: wheel-name @@ -223,7 +223,7 @@ jobs: pip install -f dist --no-index sqlalchemy python -c 'from sqlalchemy import cprocessors, cresultproxy, cutils' pip install pytest pytest-xdist ${{ matrix.extra-requires }} - pytest -n2 -q test -k 'not MockReconnectTest' --nomemory + pytest -n2 -q test --nomemory --notimingintensive else echo Not compatible. Skipping install. fi @@ -361,7 +361,7 @@ jobs: pip install -f dist --no-index sqlalchemy && python -c 'from sqlalchemy import cprocessors, cresultproxy, cutils' && pip install pytest pytest-xdist ${{ matrix.extra-requires }} && - pytest -n2 -q test -k 'not MockReconnectTest' --nomemory" + pytest -n2 -q test --nomemory --notimingintensive" - name: Get wheel names id: wheel-name diff --git a/.github/workflows/run-on-pr.yaml b/.github/workflows/run-on-pr.yaml index 52b238dabd..ad9c196e52 100644 --- a/.github/workflows/run-on-pr.yaml +++ b/.github/workflows/run-on-pr.yaml @@ -50,7 +50,7 @@ jobs: pip list - name: Run tests - run: tox -e github-${{ matrix.build-type }} -- -q --nomemory ${{ matrix.pytest-args }} + run: tox -e github-${{ matrix.build-type }} -- -q --nomemory --notimingintensive ${{ matrix.pytest-args }} # Arm emulation is quite slow (~20min) so for now just run it when merging to master # run-test-arm64: @@ -81,4 +81,4 @@ jobs: # python -m pip install --upgrade pip && # pip install --upgrade tox setuptools && # pip list && - # tox -e github-${{ matrix.build-type }} -- -q --nomemory ${{ matrix.pytest-args }}" + # tox -e github-${{ matrix.build-type }} -- -q --nomemory --notimingintensive ${{ matrix.pytest-args }}" diff --git a/.github/workflows/run-test.yaml b/.github/workflows/run-test.yaml index 61a878fdf1..79f2a60860 100644 --- a/.github/workflows/run-test.yaml +++ b/.github/workflows/run-test.yaml @@ -42,16 +42,6 @@ jobs: - x86 include: - # the mock reconnect test seems to fail on the ci in windows - - os: "windows-latest" - pytest-args: "-k 'not MockReconnectTest'" - # python 2.7 or 3.5 on windows seem to fail also test_hanging_connect_within_overflow - - os: "windows-latest" - python-version: "3.5" - pytest-args: "-k 'not MockReconnectTest and not test_hanging_connect_within_overflow'" - - os: "windows-latest" - python-version: "2.7" - pytest-args: "-k 'not MockReconnectTest and not test_hanging_connect_within_overflow'" # autocommit tests fail on the ci for some reason - python-version: "pypy3" pytest-args: "-k 'not test_autocommit_on and not test_turn_autocommit_off_via_default_iso_level and not test_autocommit_isolation_level'" @@ -96,7 +86,7 @@ jobs: pip list - name: Run tests - run: tox -e github-${{ matrix.build-type }} -- -q --nomemory ${{ matrix.pytest-args }} + run: tox -e github-${{ matrix.build-type }} -- -q --nomemory --notimingintensive ${{ matrix.pytest-args }} run-test-arm64: name: ${{ matrix.python-version }}-${{ matrix.build-type }}-arm64-ubuntu-latest @@ -132,5 +122,5 @@ jobs: python -m pip install --upgrade pip && pip install --upgrade tox setuptools && pip list && - tox -e github-${{ matrix.build-type }} -- -q --nomemory ${{ matrix.pytest-args }} + tox -e github-${{ matrix.build-type }} -- -q --nomemory --notimingintensive ${{ matrix.pytest-args }} " diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py index b5f2a3e0b8..34e3c57603 100644 --- a/lib/sqlalchemy/testing/plugin/plugin_base.py +++ b/lib/sqlalchemy/testing/plugin/plugin_base.py @@ -121,6 +121,12 @@ def setup_options(make_option): dest="nomemory", help="Don't run memory profiling tests", ) + make_option( + "--notimingintensive", + action="store_true", + dest="notimingintensive", + help="Don't run timing intensive tests", + ) make_option( "--profile-sort", type="string", @@ -346,6 +352,12 @@ def _set_nomemory(opt, file_config): exclude_tags.add("memory_intensive") +@pre +def _set_notimingintensive(opt, file_config): + if opt.notimingintensive: + exclude_tags.add("timing_intensive") + + @pre def _monkeypatch_cdecimal(options, file_config): if options.cdecimal: diff --git a/test/engine/test_pool.py b/test/engine/test_pool.py index 4cbdade18c..eb705da61a 100644 --- a/test/engine/test_pool.py +++ b/test/engine/test_pool.py @@ -955,7 +955,6 @@ class QueuePoolTest(PoolTestBase): dbapi = Mock() def failing_dbapi(): - time.sleep(2) raise Exception("connection failed") creator = dbapi.connect @@ -1890,7 +1889,7 @@ class SingletonThreadPoolTest(PoolTestBase): assert c c.cursor() c.close() - time.sleep(0.1) + time.sleep(0.01) threads = [] for i in range(10):