Ticket #23 (new defect)

Opened 2 years ago

TestCacheItem.test_item_state_transitions non-deterministic

Reported by: pjcoup@… Owned by: jajcus
Priority: minor Component: pyxmpp
Keywords: Cc:

Description

While minor, I have seen this test fail by "skipping" intermediate cache states which are expected to be visited during the test. To make the test completely reliable, we basically need to know the last "update time" for the cache item (expose the 'now' obtained in CacheItem?.update_state), and make sure the clock difference corresponds to the correct cache state. I'm attaching a sample diff for a new test and CacheItem? which exposes the last cache update time (although we probably shouldn't change the internals just to get the test to pass reliably).

Attachments

pyxmpp_cache.py.diff Download (1.3 KB) - added by pjcoup@… 2 years ago.
diff of pyxmpp/cache.py
tests_cache.py.diff Download (2.4 KB) - added by pjcoup@… 2 years ago.
diff of tests/cache.py

Change History

Changed 2 years ago by pjcoup@…

diff of pyxmpp/cache.py

Changed 2 years ago by pjcoup@…

diff of tests/cache.py

Note: See TracTickets for help on using tickets.