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.

Abstract time away from ExecutionTime

See original GitHub issue

#1076 abstracted time (Wait, Delay and more) to make testing DelegationAssertions reliable.

We should do the same for ExecutionTime.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Evangelinkcommented, Jun 24, 2019

@jnyrup I suspect that the problem is coming from the line 45 when executing !execution.Wait(rate);.

If you try to debug the test described here, you will end up with the following workflow:

  1. Set result of the delayTask to true
  2. Fake wait for 100ms (time given in the BeGreaterThan)
  3. Return true, result that was set in #1
  4. isRunning is now false so we stop the loop
  5. We execute the assertion with the currently elapsed time
  6. We fake sleep for 200ms
  7. Test fails because 100ms not strictly greater than 100ms
0reactions
dennisdoomencommented, Jul 26, 2021

I read from #1620 that you decided to keep using a real StopWatch for all remaining tests - I assume that’s to keep tests close to the actual executed paths?

Correct.

Would you prefer if I only made the same fix to When_the_execution_time_of_a_member_is_close_to_a_limit_it_should_not_throw as in #1620?

I think we should only fix the ones that tend to be unstable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle "Script timeout: exhausted allowed ...
Testing locally, it looks like my script gets killed after ~20 seconds and I get the error “Script timeout: exhausted allowed execution time”....
Read more >
Program Execution Time - an overview
Abstract interpretation helps to exclude timing accidents that cannot occur and provides the worst-case execution time for basic blocks, within their execution ......
Read more >
Worst Case Execution Time Prediction (Techniques)
Abstract states may lack information, e.g. about cache contents. Assume local worst cases is safe (in the case of no timing anomalies); Traces...
Read more >
Chapter 4: Measuring Execution Time
What a big-oh characterization of an algorithm does is to abstract away unimportant distinctions caused by factors such as different machines or different ......
Read more >
c# - How to find the execution time of a piece of code?
If you need to get query execution time in milliseconds in SQL Server Management Studio, there is a simple way to achieve this....
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