Skip to content

Commit

Permalink
Relax assertion in check_tid_ordering_w_commit test
Browse files Browse the repository at this point in the history
It is pointless for lastTransaction() to block until it is allowed to
return the TID of a transaction that has just been committed, because
it may still not be the real last TID (e.g. for some storage
implementations, invalidations are received from a shared server
via the network). While invalidations are still being processed,
it's fine to return immediately with the previous last TID.

This was clarified in commit 4a6b028
("mvccadapter: check if the last TID changed without invalidation").

See pull request #316
  • Loading branch information
jmuchemb committed Aug 19, 2020
1 parent 8303cf2 commit 3137020
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/ZODB/tests/BasicStorage.py
Expand Up @@ -347,17 +347,13 @@ def update_attempts():
attempts_cond.notifyAll()


@run_in_thread
def lastTransaction():
update_attempts()
results['lastTransaction'] = self._storage.lastTransaction()

@run_in_thread
def load():
update_attempts()
results['load'] = utils.load_current(self._storage, ZERO)[1]
results['lastTransaction'] = self._storage.lastTransaction()

expected_attempts = 2
expected_attempts = 1

if hasattr(self._storage, 'getTid'):
expected_attempts += 1
Expand Down

0 comments on commit 3137020

Please sign in to comment.