Re: [PATCH 7/9] tests: include detailed trace logs with --write-junit-xml upon failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luke,

On Wed, 5 Sep 2018, Luke Diamand wrote:

> On 5 September 2018 at 13:39, Johannes Schindelin
> <Johannes.Schindelin@xxxxxx> wrote:
> >
> > On Wed, 5 Sep 2018, Luke Diamand wrote:
> >
> >> On 4 September 2018 at 12:09, Johannes Schindelin
> >> <Johannes.Schindelin@xxxxxx> wrote:
> >> >
> >> > On Tue, 4 Sep 2018, Eric Sunshine wrote:
> >> >
> >> >> On Mon, Sep 3, 2018 at 5:10 PM Johannes Schindelin via GitGitGadget
> >> >> <gitgitgadget@xxxxxxxxx> wrote:
> >> >> > So let's do something different in VSTS: let's run all the tests with
> >> >> > `--quiet` first, and only if a failure is encountered, try to trace the
> >> >> > commands as they are executed. [...]
> >>
> >> Is this re-running just an individual test on its own or all the tests
> >> within a single file?
> >
> > Upon encountering a failed test, it is re-running the entire test script
> > afresh.
> >
> >> The latter shouldn't need this at all.
> >
> > Please do not let me die dumb. In other words, I would love for you to
> > explain what exactly you mean by that sentence.
> 
> Just re-run the script. You shouldn't need to kill p4d, as each script
> starts up its own instance of p4d, and shuts it down when it exits.
> 
> $ cd t
> $ ./t9800-git-p4-basic.sh
> Ctrl^C

That Ctrl^C is not possible in the automated builds (which are the subject
of this patch series).

What *is* possible is to detect in the test script that there was a
breakage, and then re-run the test script.

Unfortunately, at this stage the first test script has not exited yet, so
your p4d has not exited yet, and we have to clean up in some way before
re-running (because the port in use is determined by the test script's
number, so we really need to kill the old daemon).

And this is exactly what my patches try to achieve here.

> $ ./t9800-git-p4-basic.sh -v
> 
> There's a cleanup() function in lib-git-p4.sh which kills the p4d
> server, and that's invoked via:
> 
>   trap cleanup EXIT
> 
> That's the only cleanup that each of the scripts require AFAIK.

Good.

However, we really will want to consider introducing something consistent
here, something that works for *all* test scripts. IOW if any test script
wants to start a process for the life-time of that script, and needs to
kill that process at the end, we will want to have a consistent,
documented way to register a function (or commands) to be called at the
end.

And that function (or commands) need to be run also when stopping
everything in preparation for a re-run.

> >> And the former, I'm not sure will actually work - most of the tests
> >> assume some particular p4 state. But perhaps I'm missing something?
> >
> > No, the former would not work at all. Not only for the p4 tests: Git's
> > tests frequently commit the deadly sin of relying on output of one another
> > (wreaking havoc e.g. when test cases are skipped due to missing
> > prerequisites, and latter test cases relying on their output). It is not
> > the only thing that is wrong with the test suite, of course.
> >
> >> I also think it does look kind of ugly. And if there's one thing I've
> >> learned, it's that the ugly hack you write today with the words "we'll
> >> tidy this up later" goes on to live with you forever!
> >
> > Okay.
> >
> > (And having read lib-git-p4.sh, I kind of see where you learned that.)
> >
> > But maybe you also have some splendid idea what to do instead? Because
> > doing something about it, that we need. We can't just say "oh, the only
> > solution we found is ugly, so let's not do it at all".
> >
> > I am even going so far as to say: unless you have a better idea, it is
> > pretty detrimental to criticize the current approach. It is the opposite
> > of constructive.
> >
> > So let's hear some ideas how to improve the situation, m'kay?
> >
> > Just as a reminder, this is the problem I want to solve: I want to run the
> > tests in a light-weight manner, with minimal output, and only in case of
> > an error do I want to crank up the verbosity. Instead of wasting most of the
> > effort to log everything and then throwing it away in most of the common
> > cases, I suggest to re-run the entire test.
> >
> > What do you suggest to solve this?
> >
> 
> I don't know about any other tests, but the git-p4 tests don't take
> any longer in verbose mode.

That statement is too general to be correct. It may be the case in your
setup, but I found that even a redirected, chatty stderr can slow down
things on Windows substantially, probably due to the POSIX emulation going
on in the background that needs to prepare for all kinds of eventualities
(that we do not even need, but the MSYS2 runtime has no way of knowing
that).

> So one simple solution is to just run it in verbose mode - unless there
> are other tests which have more overhead.

It is a bit of an overhead. As the entire test run on Windows takes
*quite* a while (due to said POSIX emulation issues), I was not able to
quantify it exactly.

> The trap/exit/cleanup method that the git-p4 tests already use would
> seem to be ideally suited to cleaning up everything on exit.

Yes. On exit. But I cannot exit here, not before re-running the script.

> There might be some specific tests where this doesn't quite work out,
> if you let me know what they are I can have a look at fixing them for
> you.

Thanks. I will let you know when I encounter other tests than the p4 and
git-daemon tests (which I fixed in this patch series).

Ciao,
Dscho



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux