-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support GETEX and GETDEL #340
Conversation
_ <- ZIO.sleep(20.millis) | ||
res <- get(key) | ||
} yield assert(res.isDefined)(equalTo(true)) && assert(exists)(equalTo(Some(value))) | ||
} @@ eventually, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question why is this test @eventually
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because sleep is unreliable and subject to CPU and thread scheduling. 20ms is likely to cause failure. Here, it is similar to CAS. (guess)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah true, I forgot that we use the Live Clock in these tests.
} | ||
case object GetExInput extends Input[(String, Expire, Duration)] { | ||
override private[redis] def encode(data: (String, Expire, Duration)): Chunk[RespValue.BulkString] = | ||
case class GetExPersistInput[K: Schema]() extends Input[(K, Boolean)] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case classes should be final.
case object GetExInput extends Input[(String, Expire, Duration)] { | ||
override private[redis] def encode(data: (String, Expire, Duration)): Chunk[RespValue.BulkString] = | ||
case class GetExPersistInput[K: Schema]() extends Input[(K, Boolean)] { | ||
override private[redis] def encode(data: (K, Boolean))(implicit codec: Codec): Chunk[RespValue.BulkString] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove override private
. I noticed that some of the recently added inputs are using it, but please remove it everywhere together with the ones from this PR.
Please mark all test wich use generators eg |
👍 |
closed #334