Unverified Commit 80cb2db1 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

python3Packages.pyrate-limiter: disable time-sensitive tests and ones that...

python3Packages.pyrate-limiter: disable time-sensitive tests and ones that cause a build timeout (#457990)
parents 15343049 65de4fb0
Loading
Loading
Loading
Loading
+29 −8
Original line number Diff line number Diff line
@@ -2,14 +2,20 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  filelock,

  # build-system
  poetry-core,

  # optional dependencies
  filelock,
  psycopg,
  psycopg-pool,
  redis,

  # test
  pytestCheckHook,
  pytest-asyncio,
  pytest-xdist,
  redis,
  redisTestHook,
}:

@@ -41,6 +47,14 @@ buildPythonPackage rec {
    ];
  };

  # Show each test name and track the slowest
  # This helps with identifying bottlenecks in the test suite
  # that are causing the build to time out on Hydra.
  pytestFlags = [
    "--durations=10"
    "-vv"
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-asyncio
@@ -49,18 +63,25 @@ buildPythonPackage rec {
  ]
  ++ lib.flatten (lib.attrValues optional-dependencies);

  disabledTests = [
    # hangs
    "test_limiter_01"
  disabledTestPaths = [
    # Slow: > 1.5 seconds/test run standalone on a fast machine
    # (Apple M3 Max with highest performance settings and 36GB RAM)
    # and/or hang under load
    # https://github.com/vutran1710/PyrateLimiter/issues/245
    # https://github.com/vutran1710/PyrateLimiter/issues/247
    "tests/test_bucket_all.py"
    "tests/test_bucket_factory.py"
    "tests/test_limiter.py"
    "tests/test_multiprocessing.py"
  ];

  pythonImportsCheck = [ "pyrate_limiter" ];

  meta = with lib; {
  meta = {
    description = "Python Rate-Limiter using Leaky-Bucket Algorimth Family";
    homepage = "https://github.com/vutran1710/PyrateLimiter";
    changelog = "https://github.com/vutran1710/PyrateLimiter/blob/${src.tag}/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ kranzes ];
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ kranzes ];
  };
}