Raku / whateverable

šŸ¤– Different IRC bots that operate on a bunch of prebuilt Rakudo versions
https://gist.github.com/Whateverable
GNU Affero General Public License v3.0
18 stars 14 forks source link

Timeouts should be configurable #317

Closed AlexDaniel closed 4 years ago

AlexDaniel commented 6 years ago

By default bisectable/committable use 10s timeout (per each commit). Very often I find myself needing more than that (especially when module precompilation is involved), so usually I end up changing the timeout in the source code:

https://github.com/perl6/whateverable/blob/031cf5de521ba1002ab7379bedc6b432213de194/lib/Whateverable.pm6#L55

Would be nice if it was configurable (e.g. commit: timeout=30 HEAD say 42).

AlexDaniel commented 6 years ago

Another option is to make it a separate command, similarly to stdin:

\<AlexDaniel> evalable6: stdin Hello world! \<evalable6> AlexDaniel, STDIN is set to Ā«Hello world!Ā» \<AlexDaniel> m: say slurp \<evalable6> AlexDaniel, rakudo-moar ec0422e75: OUTPUT: Ā«Hello world!ā¤Ā»

ā†‘ I think that's the way to go.

AlexDaniel commented 4 years ago

I think it was started in https://github.com/Raku/whateverable/commit/5f9bcf1cf84f47ad8d206a609fb58e4eb3daeee9 and then later fixed in https://github.com/Raku/whateverable/commit/152bd39da650cc655d610e2b77c7c3a4768a0022.

This is how it works today:

\<AlexDaniel> evalable6: vars \<evalable6> AlexDaniel, commit=HEAD; timeout=10 \<AlexDaniel> evalable6: sleep 15; say 42 \<evalable6> AlexDaniel, rakudo-moar 798614cb7: OUTPUT: Ā«(signal SIGHUP) Ā«timed out after 10 secondsĀ»Ā» \<AlexDaniel> evalable6: timeout=20 \<evalable6> AlexDaniel, timeout is now set to ā€œ20ā€ (default value is ā€œ10ā€) \<AlexDaniel> evalable6: sleep 15; say 42 \<evalable6> AlexDaniel, rakudo-moar 798614cb7: OUTPUT: Ā«42ā¤Ā» \<AlexDaniel> evalable6: timeout=10 \<evalable6> AlexDaniel, timeout is now set to ā€œ10ā€ (default value is ā€œ10ā€)

So I don't think there's a need to configure timeouts for every single command. It makes command syntax much more complicated. Maybe I'll change my mind on that later, but for now we're good.