Better timeout handling#111
Conversation
marcosnils
left a comment
There was a problem hiding this comment.
I'm not sure what this is actually improving. IIUC this only adds the ability to set a default timeout via env variables?
| timer *time.Timer | ||
| } | ||
|
|
||
| func (g *G) SetDefaultTimeout(timeout time.Duration) { |
There was a problem hiding this comment.
This function is never called / used?
There was a problem hiding this comment.
Correct, this is user-facing API.
There was a problem hiding this comment.
Ok, in that case this needs to be tested. However don't add anything until we decide if it makes sense to add this functionality or not. I still don't quite understand what this is improving / fixing.
|
The issue I'm trying to address here is that if you have different tests written using different frameworks (eg. we have a bit of testify) then passing a CLI flag ( Re: Hope that makes sense? |
Interesting.. is
Kind of ... there's something that I'm not seeing here. You basically added a new We basically have:
Besides this PR needing docs and tests, it's hard to have a mental model about what happens if I set one or many of these variables. |
Correct:
Yeah, I see what you mean. TBH the main thing I care about is the ability to set the global timeout using an environment variable. Would you be open to accepting a PR with just that, obviously including tests? |
yes, that's ok. Out of curiosity, do you have a simple example to reproduce this case you have where you need goblin but sending the argument doesn't cut it? Seems like you ran into a particular case that might have a proper fix instead of adding a new feature. |
|
@marcosnils The problem is with using the |
|
In that case then maybe we can make Globin have it's own flagset through |
|
Sure, good idea in general, but that still does not make it possible to use Goblin with flags with other frameworks using the |
agree here
I don't agree here. It really depends on the use-case. In any case, I don't want this to become a debate a of when and how to use flags. Adding the support to the env variable SGTM so we can support this use-case |
|
OK let's not get into philosophical debates. I'll rewrite this PR into something that only covers the envvar, plus tests. |

No description provided.