I noticed that the `t.Run` call in the sample code provided is `t,Run`
instead (note the comma). I'm not sure how that compiles, but it might be
worth checking on that.

On Mon, Mar 23, 2020 at 3:16 PM Ian Lance Taylor <i...@golang.org> wrote:

> On Sun, Mar 22, 2020 at 11:38 PM Shane H <shane....@gmail.com> wrote:
> >
> > On Monday, March 23, 2020 at 2:49:46 PM UTC+11, Ian Lance Taylor wrote:
> >>
> >> On Sun, Mar 22, 2020 at 7:10 PM Shane H <sha...@gmail.com> wrote:
> >> >
> >> > I'm a lot confused by the behaviour of some tests I have at the
> moment, they're skipping.. when there's no skip or timeout or... anything
> that I can see
> >> >
> >> > I know this is going to be difficult because I don't have code I can
> paste to show what's happening
> >> >
> >> > I'm using go1.13.9, but this behaviour was also happening with
> go1.13.7
> >> >
> >> > I have tests run from a script with
> >> > go test ./... -v -count=1 // Note count=1 was added to try and stop
> the behaviour
> >> >
> >> > The tests that I am interested are table tests run inside
> >> > for _, testCase := range tt {
> >> >     testCase := testCase
> >> >     t,Run(testCase.name, func(t *testing.T) {
> >> >         res, err := http.DefaultClientDo(testCase.before(t))
> >> >         require.NoError(t, err)
> >> >         defer res.Body.Close()
> >> >         testCase.check(t, res)
> >> >     }
> >> > }
> >> >
> >> > When I set two of the tests to time.Sleep(time.Millisecond * 1000)
> the tests should fail
> >> >
> >> > Sometimes they do, but sometimes they instead Skip, or even report
> that they were run, passed, with an updated time (they shouldn't pass)
> >> >
> >> > Can someone point me in the direction of some helpful (perhaps)
> documentation if that's what I need to read?
> >>
> >> What do you mean when you say that the tests are skipped?  What is the
> >> output of your "go test" command?
> >>
> >> Can you show us a small complete test case that demonstrates the
> problem?
> >>
> >> Ian
> >
> >
> > I wish I could (provide a test case), but it only happens on my branch.
> >
> > The output of the go test is
> > TestQuoteDate (skipping) // or words to that effect
> >
> > I'm thinking that it /has/ to be user error, but I cannot see what I'm
> doing that's causing the problem (except making the test sleep so I can
> make the API I am interacting with trigger a bug I am trying to track down)
>
> Based on what you've said so far, I really don't see any way that this
> could be a problem in the Go tools.
>
> Ian
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUPfHZHsvhNdiKX%3DKafV0jy2nmaOcu2s3c0YKxvaNxw1g%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CANGiwgYu5%3DFEHe2-MowGV%2BaNb%3D2FZg7hJDTzJ8%3DLtdmGOhrJMw%40mail.gmail.com.

Reply via email to