We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd5cba7 commit a3dfeb3Copy full SHA for a3dfeb3
src/test/scala/PolicySpec.scala
@@ -68,6 +68,20 @@ class PolicySpec extends FunSpec with BeforeAndAfterAll {
68
Await.ready(future, Duration.Inf)
69
assert(counter.get() === 2)
70
}
71
+
72
+ it ("should retry futures passed by-name instead of caching results") {
73
+ implicit val success = Success.always
74
+ val counter = new AtomicInteger()
75
+ val future = retry.Directly(1) {
76
+ counter.getAndIncrement() match {
77
+ case 1 => Future.successful("yay!")
78
+ case _ => Future.failed(new RuntimeException("failed"))
79
+ }
80
81
+ val result: String = Await.result(future, Duration.Inf)
82
+ assert(counter.get() == 2)
83
+ assert(result == "yay!")
84
85
86
87
describe("retry.Pause") {
0 commit comments