-
Notifications
You must be signed in to change notification settings - Fork 773
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
add test and fix #3254 #3255
add test and fix #3254 #3255
Conversation
@matthid, It will cover your contributions to all Microsoft-managed open source projects. |
@matthid, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request. |
@matthid good catch, this should never have been added. Could also remove the |
|
||
|
||
[<Test>] | ||
member this.RunSynchronouslyCancellationWithDelayedResult () = |
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.
Could you add some kind of timeout to this test? Assuming the fix is not in place that test would run forever. Perhaps configurable via nunit?
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.
I actually thought about that, but to be honest there are a lot of tests with similar expectations. Not sure a timeout there is worth it, but I can of course add one if you don't agree
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.
as long as it doesn't obscure the intention of the test I 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.
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.
Thanks, done
Yep added. |
@matthid this issue seems related #2770 (comment) could you also include this here? @saul |
@eiriktsarpalis Any idea how a test for this would look like or what wrong behavior this would expose? |
That's correct. It's splitting hairs really, but I happened to spot this in the same PR you're reverting. |
@eiriktsarpalis ok perfect, added it :) |
Cheers, lgtm |
@eiriktsarpalis It seems like something doesn't like the timeout attribute, ideas? |
This reverts commit aeeaa50.
Ugh... good catch, and I'm glad we found this now rather than later. |
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.
I need to look at this again after reading further comments
src/fsharp/FSharp.Core/control.fs
Outdated
|
||
let continueWithUnit (task : Task, args, useCcontForTaskCancellation) = | ||
|
||
let continuation (completedTask : Task) : unit = | ||
args.aux.trampolineHolder.Protect((fun () -> | ||
if completedTask.IsCanceled then | ||
if useCcontForTaskCancellation | ||
then args.aux.ccont (new OperationCanceledException(args.aux.token)) |
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.
Is this an intrinsic part of this fix? Or is only https://github.com/Microsoft/visualfsharp/pull/3255/files#diff-34ee82347e9e0b47265fcecaa4850174R1567 needed? If the latter, please remove this change to keep the changes entirely separate,
src/fsharp/FSharp.Core/control.fs
Outdated
else args.aux.econt (ExceptionDispatchInfo.Capture(new TaskCanceledException(completedTask))) | ||
elif completedTask.IsFaulted then | ||
args.aux.econt (MayLoseStackTrace(completedTask.Exception)) | ||
else | ||
args.cont completedTask.Result)) |> unfake | ||
|
||
task.ContinueWith(Action<Task<'T>>(continuation), continueWithExtra args.aux.token) |> ignore |> fake |
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.
Is this an intrinsic part of this fix? Or is only https://github.com/Microsoft/visualfsharp/pull/3255/files#diff-34ee82347e9e0b47265fcecaa4850174R1567 needed? If the latter, please remove this change to keep the changes entirely separate,
src/fsharp/FSharp.Core/control.fs
Outdated
let continueWith (task : Task<'T>, args, useCcontForTaskCancellation) = | ||
|
||
let continuation (completedTask : Task<_>) : unit = | ||
args.aux.trampolineHolder.Protect((fun () -> | ||
if completedTask.IsCanceled then | ||
if useCcontForTaskCancellation | ||
then args.aux.ccont (new OperationCanceledException(args.aux.token)) | ||
then args.aux.ccont (new OperationCanceledException()) |
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.
Is this an intrinsic part of this fix? Or is only https://github.com/Microsoft/visualfsharp/pull/3255/files#diff-34ee82347e9e0b47265fcecaa4850174R1567 needed? If the latter, please remove this change to keep the changes entirely separate,
My understanding is that only the one line change https://github.com/Microsoft/visualfsharp/pull/3255/files#diff-34ee82347e9e0b47265fcecaa4850174L1575 is required for the fix, the rest is a different issue? |
The change was requested because it's part of the commit which broke this. I honestly don't care if it is part of this or not as I noted above it's basically changing nothing... So I don't understand why I had to add it (it's basically cleanup) nor why now I should remove it again :/ So I'm fine either way but don't make me change that back and forth. @dsyme Did you see the above discussion and still think I should remove it? /cc @eiriktsarpalis |
Remove it please to minimise the required change, thanks |
@matthid I updated the PR directly, thanks |
@KevinRansom this is ready |
@dsyme thanks. i'd probably rebase it and remove all those commits. but if you are fine with them I can leave it as is |
Problem is I'm quite busy the mext days so it could take a while |
@matthid No problem - we will squash & merge in any case :) |
See #3254
/cc @eiriktsarpalis