]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
add --notimingintensive; block from github jobs
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Oct 2020 03:48:47 +0000 (23:48 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Oct 2020 04:16:53 +0000 (00:16 -0400)
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

.github/workflows/create-wheels.yaml
.github/workflows/run-on-pr.yaml
.github/workflows/run-test.yaml
lib/sqlalchemy/testing/plugin/plugin_base.py
test/engine/test_pool.py

index e94f97d3b940adf546a482695be82a7de075caaa..8c2d7ee604021a9a5a4045b463bf052f16cdd525 100644 (file)
@@ -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
index 52b238dabd7a848df788ba9770fe74cce5b6d14f..ad9c196e523689df4a748be5909b71abd6c050a6 100644 (file)
@@ -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 }}"
index 61a878fdf1f027ede3d8d88ed8a8227a80bf732d..79f2a60860e51a89d6c04d476c6fce2d47bc6c55 100644 (file)
@@ -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 }}
             "
index b5f2a3e0b87c0ee4055cdf3a2687ab6020913c9b..34e3c57603120bc5b6380d0b73aa1f9d8f473000 100644 (file)
@@ -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:
index 4cbdade18c7fbec63452fa4cd4d633ab98beaf77..eb705da61abe88ca3d1eab20506f52f4e9289b95 100644 (file)
@@ -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):