Comment 2 for bug 1334020

Revision history for this message
Matt Haggard (iffy) wrote :

This usually fails for me. I run it repeatedly like this:

FAILED="0"; SUCCESS="0"; for i in {1..100}; do python test_failer.py; RESULT=$?; if [ ! "$RESULT" -eq 0 ]; then let FAILED=$FAILED+1; else let SUCCESS=$SUCCESS+1; fi; sleep 1; rm -r tmp*; done; echo "Success: $SUCCESS Failed: $FAILED"

I'm working in a clean virtual environment (using virtualenvwrapper) on an Ubuntu 12.04 LTS Vagrant VM.
Python 2.7.3

mktmpenv
pip install -U pip
pip install storm==0.20
FAILED="0"; SUCCESS="0"; for i in {1..100}; do python test_failer.py; RESULT=$?; if [ ! "$RESULT" -eq 0 ]; then let FAILED=$FAILED+1; else let SUCCESS=$SUCCESS+1; fi; sleep 1; rm -r tmp*; done; echo "Success: $SUCCESS Failed: $FAILED"

Here's a typical traceback:
Traceback (most recent call last):
  File "test_failer.py", line 76, in <module>
    runtest(store, <email address hidden>', 10)
  File "test_failer.py", line 68, in runtest
    c = list(store.find(Customer))
  File "/home/vagrant/.virtualenvs/f94aec89-57e6-4d9c-9a63-8a724332410a/local/lib/python2.7/site-packages/storm/store.py", line 221, in find
    self.flush()
  File "/home/vagrant/.virtualenvs/f94aec89-57e6-4d9c-9a63-8a724332410a/local/lib/python2.7/site-packages/storm/store.py", line 501, in flush
    self._flush_one(obj_info)
  File "/home/vagrant/.virtualenvs/f94aec89-57e6-4d9c-9a63-8a724332410a/local/lib/python2.7/site-packages/storm/store.py", line 566, in _flush_one
    obj_info.event.emit("flushed")
  File "/home/vagrant/.virtualenvs/f94aec89-57e6-4d9c-9a63-8a724332410a/local/lib/python2.7/site-packages/storm/references.py", line 831, in _break_on_remote_flushed
    self.unlink(local_info, remote_info)
  File "/home/vagrant/.virtualenvs/f94aec89-57e6-4d9c-9a63-8a724332410a/local/lib/python2.7/site-packages/storm/references.py", line 727, in unlink
    local_store.remove_flush_order(remote_info, local_info)
  File "/home/vagrant/.virtualenvs/f94aec89-57e6-4d9c-9a63-8a724332410a/local/lib/python2.7/site-packages/storm/store.py", line 436, in remove_flush_order
    self._order[pair] -= 1
KeyError: ({'primary_vars': (<storm.variables.IntVariable object at 0x1092500>,), 'store': <storm.store.Store object at 0x1085ad0>, 'sequence': 2}, {'primary_vars': (<storm.variables.IntVariable object at 0x1092578>,), <storm.references.Relation object at 0x108bed0>: {'flush_order': set([{'primary_vars': (<storm.variables.IntVariable object at 0x1092500>,), 'store': <storm.store.Store object at 0x1085ad0>, 'sequence': 2}])}, 'store': <storm.store.Store object at 0x1085ad0>, 'sequence': 1})

I don't see the same behavior when using `virtualenv` (instead of `mktmpenv`). I'm not sure why that makes a difference.