[Mesa-dev] Piglit on windows
Dylan Baker
dylan at pnwbakers.com
Tue Oct 10 21:10:39 UTC 2017
Quoting Kyriazis, George (2017-10-10 12:14:00)
>
> > On Oct 10, 2017, at 1:23 PM, Dylan Baker <dylan at pnwbakers.com> wrote:
> >
> > Quoting Kyriazis, George (2017-10-10 11:02:26)
> >>
> >>> On Oct 10, 2017, at 12:46 PM, Dylan Baker <dylan at pnwbakers.com> wrote:
> >>>
> >>> Quoting Jose Fonseca (2017-10-10 08:41:49)
> >>>> On 10/10/17 16:31, Kyriazis, George wrote:
> >>>>> Hello…
> >>>>>
> >>>>> Piglit on windows prints out a message saying “Timeout are not implemented on Windows.”. These timeouts are the test timeouts in case a test hangs.
> >>>>>
> >>>>> What do people do when running piglit on windows and they hit a timeout? I would imagine there would be a non-zero number of people running piglit on windows on a regular basis, as a regression tool...
> >>>>>
> >>>>> Thank you!
> >>>>>
> >>>>> George
> >>>>
> >>>> I haven't been involved into piglit Windows testing lately, so my
> >>>> understanding might be dated.
> >>>>
> >>>> I believe that we have timeouts when we test piglit on Windows. It's not
> >>>> implemented on piglit python framework itself, but rather on VMware
> >>>> testing framework (that driver piglit, and a bunch of other tests.)
> >>>>
> >>>> That said, I believe it would be better long term if piglit framework
> >>>> had timeouts on Windows, as it can probably track that with finer
> >>>> granularity than we do now by putting a timeout on whole piglit or
> >>>> subsets of piglit tests.
> >>>>
> >>>> python3's subprocess module has timeout options, so it should be
> >>>> relatively easy to implement on top of it, in a cross-platform manner.
> >>>>
> >>>> Jose
> >>>> _______________________________________________
> >>>> mesa-dev mailing list
> >>>> mesa-dev at lists.freedesktop.org
> >>>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >>>
> >>> Since I added that warning message...
> >>>
> >>> There are no timeouts in python 2 on windows, even with 3rd party packages.
> >>>
> >>> For python 3 to properly handle timeouts you need to kill the process that
> >>> exceeds the expected timeout. Basically when timeout expires the sub-process
> >>> communicate call stops blocking, but doesn't actually kill the process. On Linux
> >>> we ask the process to terminate, wait 3 seconds and then SIGKILL it.
> >>>
> >>> I don't know how to do that on windows, so I didn't implement it and instead
> >>> windows users get a warning. If someone with a basic grasp of how to kill a
> >>> process on windows wanted that functionality it probably wouldn't be too hard to
> >>> implement.
> >>>
> >>> Alternatively there are constructs that are only in python 3 that do the killing
> >>> for you, on both Windows and Linux, but they don't have a python 2 equivalent.
> >>>
> >> Hmm.. Since the current code has special cases between python 2/3 and windows/linux, finding a cross-platform method for both OSes seems like a “nice to have” at this point, although desirable.
> >>
> >> I’ll see if I can find a quick fix for this.
> >>
> >> Thank you!
> >>
> >> George
> >>
> >>> Dylan
> >>
> >
> > You could have a look at framework/test/base.py, the logic is in there. I don't
> > think it would really be that much code to add to that mess, and we could always
> > delete it whenever we finally decide that we don't care about python 2 anymore.
> >
> > Dylan
>
> The interest is for python3, I don’t think windows piglit works with python2 anyway. The README file lists python3 as a requirement for windows.
>
> So, I did some simple tests with Popen() on windows, and it looks like commnicate() understands the timeout argument, and proc.kill() seems to work (at least for simple things, like “sleep”).
>
> Maybe python3 support changed between the time you wrote the code and now? I’m using Python 3.6.3.
>
> Thanks,
>
> george
>
I don't remember why I didn't use proc.kill when I implemented it, but it's been
present since at least 3.2 and subprocess32 supports it, so it would probably be
fine to to drop the Linux specific code and use proc.kill instead.
I think to test it I had written a small python script that caught and ignored
SIGTERM to ensure that the SIGKILL functionality actually worked, but it was a
while ago so I could be misremembering.
Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171010/f30150a1/attachment-0001.sig>
More information about the mesa-dev
mailing list