Skip to content

Commit c37e835

Browse files
author
Andrei Goncharov
authored
Revert "Merge pull request #358 from hyperledger/increase-mx-size-limit" (#372)
This reverts commit 1ba2d75.
1 parent 8642be5 commit c37e835

File tree

3 files changed

+12
-28
lines changed

3 files changed

+12
-28
lines changed

plenum/test/cli/test_long_msg_err.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,9 @@
33
import pytest
44
from stp_core.common.log import Logger
55

6-
@pytest.fixture(scope="function")
7-
def patch_msg_len(tconf):
8-
old_value = tconf.MSG_LEN_LIMIT
9-
tconf.MSG_LEN_LIMIT = 128 * 1024
10-
yield tconf.MSG_LEN_LIMIT
11-
print(old_value)
12-
tconf.MSG_LEN_LIMIT = old_value
136

147
def test_error_if_long_message(
15-
patch_msg_len, cli, tconf, createAllNodes, validNodeNames, set_info_log_level):
8+
cli, tconf, createAllNodes, validNodeNames, set_info_log_level):
169
operation = '{{"Hello": "{}"}}'.format("T" * tconf.MSG_LEN_LIMIT)
1710
createClientAndConnect(cli, validNodeNames, "Alice")
1811

stp_core/config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,4 @@
4444

4545

4646
# All messages exceeding the limit will be rejected without processing
47-
# TODO: need to think about a lower value; currently low value leads to
48-
# problems with batching on transport level
49-
MSG_LEN_LIMIT = 128 * 1024 * 1024
47+
MSG_LEN_LIMIT = 128 * 1024

stp_zmq/test/test_zstack.py

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import pytest
2-
from stp_core.common.util import adict
2+
33
from stp_core.crypto.util import randomSeed
44
from stp_core.loop.eventually import eventually
55
from stp_core.network.port_dispenser import genHa
66
from stp_core.test.helper import Printer, prepStacks, chkPrinted
77
from stp_zmq.test.helper import genKeys, create_and_prep_stacks, \
88
check_stacks_communicating, get_file_permission_mask, get_zstack_key_paths
99
from stp_zmq.zstack import ZStack
10+
from stp_core.common.util import adict
1011

1112

1213
def testRestricted2ZStackCommunication(tdir, looper, tconf):
@@ -81,7 +82,7 @@ def test_zstack_non_utf8(tdir, looper, tconf):
8182
alpha.transmit(b'{"k2": "v2\x9c"}', uid, serialized=True)
8283
with pytest.raises(AssertionError):
8384
looper.run(eventually(chkPrinted, betaP, {"k2": "v2\x9c"}))
84-
# TODO: A better test where the output of the parsing method is checked
85+
# TODO: A better test where the output of the parsing method is checked
8586
# requires spyable methods
8687

8788
# Again send a utf-8 message and see its received (checks if stack is
@@ -158,21 +159,13 @@ def create_stack(name, handler=None):
158159

159160
assert len(received_messages) != 0
160161
assert len(expected_messages) == len(received_messages), \
161-
"{} != {}, LAST IS {}".format(len(expected_messages),
162-
len(received_messages),
163-
received_messages[-1])
164-
165-
166-
@pytest.fixture(scope="function")
167-
def patch_msg_len(tconf):
168-
old_value = tconf.MSG_LEN_LIMIT
169-
tconf.MSG_LEN_LIMIT = 128 * 1024
170-
yield tconf.MSG_LEN_LIMIT
171-
print(old_value)
172-
tconf.MSG_LEN_LIMIT = old_value
162+
"{} != {}, LAST IS {}"\
163+
.format(len(expected_messages),
164+
len(received_messages),
165+
received_messages[-1])
173166

174167

175-
def testZStackSendRecvHugeDataUnderLimit(patch_msg_len, tdir, looper, tconf):
168+
def testZStackSendRecvHugeDataUnderLimit(tdir, looper, tconf):
176169
names = ['Alpha', 'Beta']
177170
genKeys(tdir, names)
178171

@@ -209,7 +202,7 @@ def recvHandlerBeta(wrpMsg):
209202
assert betaHandler[0] is True
210203

211204

212-
def testZStackSendHugeDataOverLimit(patch_msg_len, tdir, looper, tconf):
205+
def testZStackSendHugeDataOverLimit(tdir, looper, tconf):
213206
names = ['Alpha', 'Beta']
214207
genKeys(tdir, names)
215208

@@ -254,7 +247,7 @@ def rejectHandlerBeta(reason, frm):
254247
assert betaHandlers[1] is False
255248

256249

257-
def testZStackRecvHugeDataOverLimit(patch_msg_len, tdir, looper, tconf):
250+
def testZStackRecvHugeDataOverLimit(tdir, looper, tconf):
258251
names = ['Alpha', 'Beta']
259252
genKeys(tdir, names)
260253

0 commit comments

Comments
 (0)