summaryrefslogtreecommitdiff
path: root/dev-python/dugong/files/3.2-aborted_write.patch
blob: bf25a3772e15307bb5e4c63c1fb5dabe80ca39b0 (plain)
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
https://bitbucket.org/nikratio/python-dugong/issue/13/test_aborted_write-failures-in-latest
diff --git a/test/test_dugong.py b/test/test_dugong.py
--- a/test/test_dugong.py
+++ b/test/test_dugong.py
@@ -540,7 +540,7 @@
     conn.readall()
 
 def test_aborted_write1(conn, monkeypatch):
-    BUFSIZE = 64*1024
+    BUFSIZE = 640*1024
 
     # Monkeypatch request handler
     def do_PUT(self):
@@ -561,8 +561,9 @@
 
     # Try to write data
     with pytest.raises(ConnectionClosed):
-        for _ in range(50):
+        for _ in range(5000):
             conn.write(b'f' * BUFSIZE)
+            time.sleep(0.1)
 
     # Nevertheless, try to read response
     resp = conn.read_response()
@@ -570,7 +571,7 @@
     assert resp.reason == 'Please stop!'
 
 def test_aborted_write2(conn, monkeypatch):
-    BUFSIZE = 64*1024
+    BUFSIZE = 640*1024
 
     # Monkeypatch request handler
     def do_PUT(self):
@@ -589,8 +590,9 @@
 
     # Try to write data
     with pytest.raises(ConnectionClosed):
-        for _ in range(50):
+        for _ in range(5000):
             conn.write(b'f' * BUFSIZE)
+            time.sleep(0.1)
 
     # Nevertheless, try to read response
     assert_raises(ConnectionClosed, conn.read_response)