Skip to content
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

Remmidemmi: call 'traceEndTask' in the finally block of a try-finally, so that it is always closed, even if the task throws an exception. #1379

Merged
merged 1 commit into from
Sep 19, 2016

Conversation

0x53A
Copy link
Contributor

@0x53A 0x53A commented Sep 18, 2016

should fix all / most issues similar to this: #1079

Script

FakeTestTests.zip

Target "Test" (fun _ ->
  System.Diagnostics.Debugger.Launch() |> ignore
  try
    [ @"C:\Users\lr\Documents\visual studio 2015\Projects\FakeTestTests\test\FakeTestTests.exe" ]
    |> Fake.Testing.XUnit2.xUnit2 (fun p ->
        {p with
                XmlOutputPath = Some <| testDir + "TestResults.xml" })
  with
  | _ -> printfn "Got an Exception!"
)

Before
image

after
image

I have only tested the XUnit tasks, but since the same pattern was appliead in other places, I also wrapped these in try-finally.

… is always closed, even if the task throws an exception.
@forki
Copy link
Member

forki commented Sep 19, 2016

💋

@forki forki merged commit 8a63489 into fsprojects:master Sep 19, 2016
@0x53A 0x53A deleted the task-trace-try-finally branch April 16, 2017 14:41
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