question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests are still started after cancellation

See original GitHub issue

I have a bunch of test suites created using testSequencedGroup. I run them using runTestsInAssemblyWithCancel and expect that after the cancellation token is cancelled all the pending groups don’t even start. But it is not what happens, all tests in the project are attempted. afterRunTests is executed immediately after I press Ctrl-C.

Here is an excerpt from my main function:

  [<EntryPoint>]
  let main argv =
    // ...
    use cts = new Threading.CancellationTokenSource()
    Console.CancelKeyPress.Add <| fun arg ->
      cts.Cancel()
      arg.Cancel <- true
    Tests.afterRunTests BrowserPool.cleanup
    Tests.runTestsInAssemblyWithCancel cts.Token testConfig argv

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jzabroskicommented, Jul 3, 2019

@haf My bad. I did not see the Console.CancelKeyPress.Add in the code. That’s what I get for waking up and reading code before coffee.

1reaction
jzabroskicommented, Jul 3, 2019

Handling control c requires different logic

Read more comments on GitHub >

github_iconTop Results From Across the Web

Got an email that a test was cancelled while sitting on ...
Got an email that a test was cancelled while sitting on zoom waiting for it to start. So today I had my first...
Read more >
Test Cancellation: A College of American Pathologists Q ...
Requests for laboratory testing are canceled after a specimen has already been collected from the patient for many reasons.
Read more >
Cancelled lab tests—study analyzes why
The two main reasons for test cancellation are problems with the order and preanalytical problems with the specimen. ... Nearly 52 percent of...
Read more >
Testing, Cancelling Flows still triggered
Solved: Anyone else had issue where they have tested a Flow then cancelled the remaining actions but still seem to be triggered? I...
Read more >
What is a Cancelled Drug Test?
A cancelled drug test is one in which the Medical Review Officer (MRO) finds a serious flaw in the testing process. It is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found