-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
replace-flatmap-to-guaranteeCase #934
replace-flatmap-to-guaranteeCase #934
Conversation
@alexandru The following test fails: test("Task.wanderUnordered should log errors if multiple errors happen") { implicit s =>
implicit val opts = Task.defaultOptions.disableAutoCancelableRunLoops
val ex = DummyException("dummy1")
var errorsThrow = 0
val gather = Task.wanderUnordered(Seq(0, 0)) { _ =>
Task.raiseError[Int](ex).executeAsync.doOnFinish { x =>
if (x.isDefined) errorsThrow += 1; Task.unit
}
}
val result = gather.runToFutureOpt
s.tick()
assertEquals(result.value, Some(Failure(ex)))
assertEquals(s.state.lastReportedError, ex)
assertEquals(errorsThrow, 2)
} because with |
If there is a sample of how autoCancelableRunLoops behave, can you tell me? |
Enabling AutoCancelableRunLoops cancels the processing after the task where the error occurred. I want to continue processing even if an error occurs in this test, but because the processing is canceled on the way, the test did not pass. Is this forecast correct? |
It is a flag which tells whether we should check for cancelation status after asynchronous boundary
Pretty much. I think if you add val gather = Task.wanderUnordered(Seq(0, 0)) { _ =>
Task.raiseError[Int](ex).executeAsync.doOnFinish { x =>
if (x.isDefined) errorsThrow += 1; Task.unit
}.uncancelable
} they will pass with your implementation. I think the task actually finishes before cancelation but is still considered canceled so it is |
BTW @BambooTuna Could you also remove You will have to add |
To @Avasil What I added
QuestionIn the test, I get an error of
, in my local environment.
I don't know if i have to change it. Other
Thanks for the sample code!
|
project/MimaFilters.scala
Outdated
exclude[IncompatibleMethTypeProblem]("monix.eval.internal.TaskRunLoop.popNextBind") | ||
exclude[IncompatibleMethTypeProblem]("monix.eval.internal.TaskRunLoop.popNextBind"), | ||
// Breaking changes for https://github.com/monix/monix/pull/934 | ||
exclude[MissingClassProblem]("monix.eval.Task$DoOnFinish") |
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.
There are two lists, this one is older, try putting it at the top in the first Seq
You can verify it with mimaReportBinaryIssues
Take your time and thank you for the interest in contributing!
I don't recall any problems with it so let's see if it fails on CI
The issue was possibly wrong test (unless I'm wrong here but in that case, |
Tests pass in a local environment, but it is useless in CI. . . |
I think tests arent formatted, try |
@Avasil |
Thank you @BambooTuna ! That's awesome. I'm going back to Europe soon. I'll wait until I come back to merge PR in case other maintainers have thoughts about the issue with earlier version of the test. |
@BambooTuna |
* replace-flatmap-to-guaranteeCase * Add uncancelable * Remove DoOnFinish class * Add MissingClassProblem, and fmt code * fix mimaReportBinaryIssues * fmt code
fixes #915