Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit ea3ebe0

Browse files
committed
fix non-deterministic test
1 parent ec81201 commit ea3ebe0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

ethereum/tests/test_vm_failing.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,17 @@ def mk_test_func(filename, testname, testdata):
5050
def test_testutils_check_vm_test():
5151
func_name, filename, testname, testdata = collected[1]
5252
testutils.check_vm_test(testutils.fixture_to_bytes(testdata))
53-
# manipulate post data
54-
storage = tuple(testdata['post'].values())[0]['storage']
55-
assert storage['0x23'] == '0x01'
56-
storage['0x23'] = '0x02'
53+
for address_data in testdata['post'].values():
54+
storage = address_data['storage']
55+
if "0x23" not in storage:
56+
continue
57+
assert storage['0x23'] == '0x01'
58+
# manipulate post data
59+
storage['0x23'] = '0x02'
60+
break
61+
else:
62+
raise AssertionError("Did not find `0x23` in storage values")
63+
5764
failed_as_expected = False
5865
try:
5966
testutils.check_vm_test(testutils.fixture_to_bytes(testdata))

0 commit comments

Comments
 (0)