tendersearls / tldr

A Ruby test framework for people who don't have time for slow tests 💣💥
MIT License
250 stars 4 forks source link

Print backtrace of cancelled tests with new option #13

Closed henrahmagix closed 10 months ago

henrahmagix commented 10 months ago

--verbose-cancelled-trace

This can help debug whether the cancelled tests were hungup and wouldn't ever have completed due to a parallelisation issue, or if they were just plain too slow.

This has been very helpful for my own debugging in trying to determine the cause of some small tests that usually run super fast, instead taking too long, and hanging indefinitely when env CI=true is set and def $stderr.tty? = false is mocked to make TLDR skip the 1.8 second time_bomb.

So maybe it's worth becoming an option in this library, to print more helpful information about cancelled tests, when requested =) hence the new verbose option instead of combining it onto --verbose, otherwise tests that are always slow (and the dev knows this) would print far too much noise.

What do you think?

Related to #12

henrahmagix commented 10 months ago
  1) Error:
SuiteSummaryTest#test_verbose_summary_too_slow:
RuntimeError: Ran "suite_summary_too_slow.rb" and expected failure, but exited code 0

stdout:
Command: bundle exec tldr --verbose-cancelled-trace "tests/fixture/suite_summary_too_slow.rb"
🌱 --seed 5095

🏃 Running:

😁😁

Finished in 2002ms.

ooohhhh, of course, it's in CI so TLDR runs without the time_bomb 🤦‍♂️

henrahmagix commented 10 months ago

README updated in 0f46dfa =)

Seems there's a flakey test, where a seed argument is missing: I'll see if I can replicate and hunt down a fix to make it stable, cos I like to have a bit of fun sometimes =)

1) Failure:
ConfigTest#test_cli_conversion_cuts_off_prepended_pwd [/home/runner/work/tldr/tldr/tests/config_test.rb:119]:
--- expected
+++ actual
@@ -1 +1 @@
-"--seed 1 --helper \"test_helper.rb\" --load-path \"app\" --load-path \"/lol/ok/lib\" --prepend \"foo.rb\" --exclude-path \"bar.rb\" \"baz.rb\""
+"--helper \"test_helper.rb\" --load-path \"app\" --load-path \"/lol/ok/lib\" --prepend \"foo.rb\" --exclude-path \"bar.rb\" \"baz.rb\""
henrahmagix commented 10 months ago

Discovered the flakey config test was actually flakiness in the config class due to rand and to_cli_argv! fixed in fc75c30a2c65b3b379c258c4f1e5c6dcb01bc425 =)

henrahmagix commented 10 months ago

Unsure why ruby-head is failing to find mutex_m in kernal_require :'< https://github.com/tendersearls/tldr/actions/runs/7481183084/job/20362237412?pr=13

Can we rerun in a day or two to see if it's solved?

searls commented 10 months ago

Yep, re-running failed. Trying an empty commit on main: https://github.com/tendersearls/tldr/actions/runs/7492717132/job/20396857127

henrahmagix commented 10 months ago

Thanks so much! ✌️✨

searls commented 10 months ago

landed in 0.10.0

On Thu, Jan 11, 2024 at 3:14 PM Henry Blyth @.***> wrote:

Thanks so much! ✌️✨

— Reply to this email directly, view it on GitHub https://github.com/tendersearls/tldr/pull/13#issuecomment-1887894848, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAATLR6CWJEBQZJ3TVQN4UTYOBB3TAVCNFSM6AAAAABBGZXTV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBXHA4TIOBUHA . You are receiving this because you modified the open/close state.Message ID: @.***>