Description
I have a test which exercises Siesta and the persistent cache that I wrote that Siesta uses. Today I noticed that this test is failing, when it used to work. In the test I setup a resource, call loadIfNeeded, then when I get a .newData with the event source .network (the actual network call uses URL mocking), I wipe the resource, and then wait for another .newData with a source of .wipe, then load the resource again. I expect this to get data from my cache which got populated by the first load. However, it seems that the resource is making a new request before the cache has returned a result. Is that expected? Is there supposed to be a race between the request and the cache hit, and I just got lucky before? If so, got any suggestions on how to change my test?