Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

TestCacheItem.test_item_state_transitions non-deterministic #23

@Jajcus

Description

@Jajcus

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions