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

Re: [Xen-devel] [XTF PATCH 3/3] xtf-runner: support two modes for getting output



On Thu, Aug 11, 2016 at 11:49:29AM +0100, Ian Jackson wrote:
> Wei Liu writes ("[XTF PATCH 3/3] xtf-runner: support two modes for getting 
> output"):
> > We need two modes for getting output:
> ...
> > +    # Use time to generate unique stamps
> > +    start_stamp = "===== XTF TEST START %s =====" % local_time
> > +    end_stamp = "===== XTF TEST END %s =====" % local_time
> 
> This will go wrong if someone runs the same test very rapidly in a
> loop.  It needs to be augmented, at least.
> 
> Ideally with the domid, but AFAICT that's not available here.  If you
> can't think of anything else, use, in addition to the timestamp, the
> pid of the xtf-runner process, plus a counter.  (The counter is
> necessary in case the same xtf-runner process is used to run the same
> test multiple times.)
> 
> > +    f = open(fn, "rb")
> > +    output = f.readlines()
> > +    f.close()
> > +    lines = []
> > +    found = False
> > +    for line in output:
> > +        if end_stamp in line:
> > +            break
> > +        if start_stamp in line:
> > +            found = True
> > +            continue
> > +        if not found:
> > +            continue
> > +        lines.append(line)
> 
> This is accidentally quadratic in the number of test executions.
> Do we care ?
> 

I don't think so. That's why I used this simple algorithm. I don't
expect the log files to even exceed a few MBs. We can optimise later if
there is a test that would generate a huge amount of output.

Anyway, I think the stamps and the algorithm issues will become moot if
we seek to the end of the file and read it after the test is finished as
Andrew suggested. What do you think of that?

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.