Closed connor-ricks closed 10 months ago
Hmm... This test is passing for me locally.
Actually looks like this test is a little flakey on main
and my branch here. 🤔
I figured out what's going on.
It looks like your reset function dispatches work using an async Task. this results in a race condition as you are calling reset during your unit tests setup.
Perhaps a change to .reset()
is needed? 🤔
Alternatively a change could be made to the tests. You could put the @StoredValue
inside each test.
Thank you so much for the help @connor-ricks! As we discussed elsewhere I've gone ahead and made some changes today to address both the Equatable
conformance and the @MainActor
test flakiness. I think the change to remove Equatable
conformance is a good one, and going forward @StoredValue
operate on @MainActor
which means we shouldn't run into this test flakiness.
Thanks again, sorry it took me a bit to get to, but I'm really grateful for the contribution!
Removes the unnecessary
Equatable
constraint on stored items as we can make use of thecacheIdentifier
instead, which is already supposed to uniquely identify the object.