File: 0004-Remove-networking-tests.patch

package info (click to toggle)
python-eventlet 0.20.0-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,376 kB
  • sloc: python: 31,120; sh: 208; makefile: 90
file content (76 lines) | stat: -rw-r--r-- 2,750 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
From 68d2e5b5da2da0a22e07c605ca4dccd57a0e3cb6 Mon Sep 17 00:00:00 2001
From: Thomas Goirand <zigo@debian.org>
Date: Fri, 4 Aug 2017 21:47:18 +0200
Subject: Remove networking tests

 Upstream is attempting connection to 192.0.2.1 on port 80, and expects
 it to always timeout. However, some Debian users may well have a web
 server running on that IP address, meaning the test would fail in such
 setup (even if this is reserved IANA IPs). Therefore, removing such bad
 tests.
 .
 Also, these tests have been failing for a reason on my arm64 builder,
 probably because it's a slow machine.
Forwarded: no
Last-Update: 2016-07-19
---
 tests/greenio_test.py | 20 --------------------
 tests/socket_test.py  |  7 -------
 2 files changed, 27 deletions(-)

diff --git a/tests/greenio_test.py b/tests/greenio_test.py
index 619ccd0..4e0069d 100644
--- a/tests/greenio_test.py
+++ b/tests/greenio_test.py
@@ -74,18 +74,6 @@ class TestGreenSocket(tests.LimitedTestCase):
             # 3.x io write to closed file-like pbject raises ValueError
             self.assertRaises(ValueError, fd.write, b'a')
 
-    def test_connect_timeout(self):
-        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        s.settimeout(0.1)
-        gs = greenio.GreenSocket(s)
-
-        try:
-            expect_socket_timeout(gs.connect, ('192.0.2.1', 80))
-        except socket.error as e:
-            # unreachable is also a valid outcome
-            if not get_errno(e) in (errno.EHOSTUNREACH, errno.ENETUNREACH):
-                raise
-
     def test_accept_timeout(self):
         s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         s.bind(('', 0))
@@ -95,14 +83,6 @@ class TestGreenSocket(tests.LimitedTestCase):
         gs = greenio.GreenSocket(s)
         expect_socket_timeout(gs.accept)
 
-    def test_connect_ex_timeout(self):
-        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        s.settimeout(0.1)
-        gs = greenio.GreenSocket(s)
-        e = gs.connect_ex(('192.0.2.1', 80))
-        if e not in (errno.EHOSTUNREACH, errno.ENETUNREACH):
-            self.assertEqual(e, errno.EAGAIN)
-
     def test_recv_timeout(self):
         listener = greenio.GreenSocket(socket.socket())
         listener.bind(('', 0))
diff --git a/tests/socket_test.py b/tests/socket_test.py
index 954eba3..241ce83 100644
--- a/tests/socket_test.py
+++ b/tests/socket_test.py
@@ -9,13 +9,6 @@ from eventlet.support import greendns
 import tests
 
 
-def test_create_connection_error():
-    try:
-        socket.create_connection(('192.0.2.1', 80), timeout=0.1)
-    except (IOError, OSError):
-        pass
-
-
 def test_recv_type():
     # https://github.com/eventlet/eventlet/issues/245
     # socket recv returning multiple data types