Commit cc66aee9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 83e6cc19
......@@ -417,12 +417,11 @@ def commit(description, skipIfEmpty=False): # -> tid | None
zconn = txn._resources[0]
assert isinstance(zconn, Connection)
assert len(zconn._registered_objects) > 0
obj = zconn._registered_objects[0]
# FIXME vvv fails sometims with obj._p_state=0 (UPTODATE)
# see e.g. https://erp5.nexedi.net/test_result_module/20201016-89AA413F/5
# XXX objects in zconn._registered_objects are not necessarily in CHANGED state:
# NOTE objects in zconn._registered_objects are not necessarily in CHANGED state:
# https://github.com/zopefoundation/ZODB/blob/5.6.0-19-gdad778016/src/ZODB/Connection.py#L516-L530
assert obj._p_state == CHANGED, (obj._p_state, obj)
changed_objects = [obj for obj in zconn._registered_objects if obj._p_state == CHANGED]
assert len(changed_objects) > 0
obj = changed_objects[0]
txn.commit()
return obj._p_serial
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment