about summary refs log tree commit diff
path: root/pkgs/development/python-modules/websockets/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/websockets/default.nix')
-rw-r--r--pkgs/development/python-modules/websockets/default.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/pkgs/development/python-modules/websockets/default.nix b/pkgs/development/python-modules/websockets/default.nix
index 2e13d95c3825c..7d6f78902d0a7 100644
--- a/pkgs/development/python-modules/websockets/default.nix
+++ b/pkgs/development/python-modules/websockets/default.nix
@@ -23,11 +23,25 @@ buildPythonPackage rec {
   # Tests fail on Darwin with `OSError: AF_UNIX path too long`
   doCheck = !stdenv.isDarwin;
 
-  # Disable all tests that need to terminate within a predetermined amount of
-  # time. This is nondeterministic.
   patchPhase = ''
+    # Disable all tests that need to terminate within a predetermined amount of
+    # time. This is nondeterministic.
     sed -i 's/with self.assertCompletesWithin.*:/if True:/' \
       tests/legacy/test_protocol.py
+
+    # Disables tests relying on tight timeouts to avoid failures like:
+    #   File "/build/source/tests/legacy/test_protocol.py", line 1270, in test_keepalive_ping_with_no_ping_timeout
+    #     ping_1_again, ping_2 = tuple(self.protocol.pings)
+    #   ValueError: too many values to unpack (expected 2)
+    for t in \
+             test_keepalive_ping_stops_when_connection_closing \
+             test_keepalive_ping_does_not_crash_when_connection_lost \
+             test_keepalive_ping \
+             test_keepalive_ping_not_acknowledged_closes_connection \
+             test_keepalive_ping_with_no_ping_timeout \
+      ; do
+      sed -i "s/def $t(/def skip_$t(/" tests/legacy/test_protocol.py
+    done
   '';
 
   checkPhase = ''