Decrease timing sensitivity of ignore.TestCache

This commit is contained in:
Jakob Borg 2015-07-14 12:12:57 +02:00
parent 50eb968109
commit 8fab7ec5e3

View File

@ -52,14 +52,16 @@ func TestCache(t *testing.T) {
// Sleep and access, to get some data for clean // Sleep and access, to get some data for clean
time.Sleep(100 * time.Millisecond) time.Sleep(500 * time.Millisecond)
c.get("true") c.get("true")
time.Sleep(100 * time.Millisecond) time.Sleep(100 * time.Millisecond)
// "false" was accessed 200 ms ago, "true" was accessed 100 ms ago. // "false" was accessed ~600 ms ago, "true" was accessed ~100 ms ago.
// This should clean out "false" but not "true" // This should clean out "false" but not "true"
c.clean(150 * time.Millisecond) c.clean(300 * time.Millisecond)
// Same values should exist // Same values should exist