Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adamgfraser
Copy link
Contributor

We were using foldM in TestAspect#flaky so we were not retrying tests that died. In particular, this is relevant to using flaky in combination with TestAspect#timeout, since timeout causes a test to die if the timeout is exceeded. This PR fixes this by using foldCauseM and adds a test to prevent regression.

@adamgfraser
Copy link
Contributor Author

Thanks to @unclebob418 for reporting!

@adamgfraser adamgfraser requested a review from jdegoes October 28, 2019 11:08
@adamgfraser adamgfraser mentioned this pull request Oct 28, 2019
@jdegoes
Copy link
Member

jdegoes commented Oct 28, 2019

These type of issues were what originally motivated the effect failure = test failure. After living with the new model, do you think it is on the net still an improvement?

@adamgfraser
Copy link
Contributor Author

I think it is less than ideal to have assertion failures and runtime failures in separate channels. The challenge is that with making Spec effectual there is an E type there that we need to keep polymorphic for user errors. So we can't put test failures there while remaining fully polymorphic in the error type in Spec.

One idea is that we could specialize Spec to ZSpec, so that the error channel of Spec was fixed to TestFailure[E], similar to how the error channel in ZStream is specialized to Option[E]. Then we would have to map the error from any effects into a TestFailure but it seems from the experience with ZStream that would be doable. The downside is we would be losing a little more generality in Spec but I don't think the generality is buying us much given how much of our other functionality like test aspects is already specialized to ZSpec.

What do you think?

@adamgfraser adamgfraser merged commit 4033449 into zio:master Oct 28, 2019
@adamgfraser adamgfraser deleted the flaky branch October 28, 2019 15:26
ghostdogpr pushed a commit to ghostdogpr/scalaz-zio that referenced this pull request Nov 5, 2019
Twizty pushed a commit to Twizty/zio that referenced this pull request Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants