Closed lloydmeta closed 8 years ago
Hah, coverage decreased because I added lines to handle cases that should never happen (missed translation of status...)
Does it work? :-)
Ah, was still polishing the PR :) DRY'ed it up a bit more to make failure handling a bit less repetitive on the SpyMemcachedIntegration
level and now we have +1.5% coverage.
Does it work? :-)
So far the tests are passing, which is a good sign. Since it's a bit hard to force the underlying SpyMemcached to throw unsupported statuses, I manually disabled handling of valid cases in realAsyncGet
, ran the tests again, and saw that we got the following:
[info] shade.UnhandledStatusException: For key hello - shade.memcached.internals.CASNotFoundStatus$
[info] at shade.memcached.MemcachedImpl.shade$memcached$MemcachedImpl$$throwExceptionOn(MemcachedImpl.scala:291)
which looks like the proper failure path in the MemcachedImpl
layer that we want. Looking at the previous code, I don't think we would have ever been able to get to MemcachedImpl.scala:291
, since as you mentioned, the future would never get completed due to error throwing !
Dude, so overall looks good.
👍 so if you think it's good, you can merge.
In reference to @alexandru's comment in #38 , try to complete the future when faced with untranslatable statuses instead of throwing.
Also: