<div dir="ltr"><div dir="ltr"><div>Hi,</div><div><br></div><div>Depending on timing in a test is quite brittle in general: can we mock the timeout instead and make this fully deterministic somehow?<br></div><div><br></div><div>The test has this comment: </div><div><br></div><div><div>> FIXME: This test is fragile because it relies on time which can</div><div>> be affected by system performance. In particular we are currently</div><div>> assuming that `short.py` can be successfully executed within 2</div><div>> seconds of wallclock time.</div></div><div dir="ltr"><br></div><div>Maybe "short.py" can be replaced by adding into lit itself a "no op" which would just not really spawn a process and instead mark the task as completed immediately internally?</div><div><br></div><div>-- </div><div>Mehdi</div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 16, 2020 at 10:24 PM David Blaikie via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">I appreciate the value of the feature - but it's possible the test<br>
doesn't pull its weight. Is the code that implements the feature<br>
liable to failure/often touched? If it's pretty static/failure is<br>
unlikely, possibly the time and flaky failures aren't worth the value<br>
of possibly catching a low-chance bug.<br>
<br>
Another option might be to reduce how often/in which configurations<br>
the test is run - LLVM_ENABLE_EXPENSIVE_CHECKS presumably only works<br>
for code within LLVM itself, and not test cases - but maybe I'm wrong<br>
there & this parameter could be used (& then the timing bumped up<br>
quite a bit to try to make it much more reliable), or something<br>
similar could be implemented at the lit check level?<br>
<br>
Ah, compiler-rt tests use EXPENSIVE_CHECKS to disable certain tests:<br>
<br>
./compiler-rt/test/lit.common.configured.in:set_default("expensive_checks",<br>
@LLVM_ENABLE_EXPENSIVE_CHECKS_PYBOOL@)<br>
./compiler-rt/test/fuzzer/large.test:UNSUPPORTED: expensive_checks<br>
<br>
Could you bump the timeouts a fair bit and disable the tests except<br>
under expensive checks?<br>
<br>
On Wed, Sep 16, 2020 at 9:31 PM Dan Liew <<a href="mailto:dan@su-root.co.uk" target="_blank">dan@su-root.co.uk</a>> wrote:<br>
><br>
> Hi David,<br>
><br>
> Unfortunately writing a reliable test is tricky given that the<br>
> functionality we're trying to test involves timing. I would advise<br>
> against disabling the test entirely because it actually tests<br>
> functionality that people use. I'd suggest bumping up the time limits.<br>
> This is what I've done in the past. See<br>
><br>
> commit 6dfcc78364fa3e8104d6e6634733863eb0bf4be8<br>
> Author: Dan Liew <<a href="mailto:dan@su-root.co.uk" target="_blank">dan@su-root.co.uk</a>><br>
> Date:   Tue May 22 15:06:29 2018 +0000<br>
><br>
>     [lit] Try to make `shtest-timeout.py` test more reliable by using a<br>
>     larger timeout value. This really isn't very good because it will<br>
>     still be susceptible to machine performance.<br>
><br>
>     While we are here also fix a bug in validation of<br>
>     `maxIndividualTestTime` where previously it wasn't checked if the<br>
>     type was an int.<br>
><br>
>     rdar://problem/40221572<br>
><br>
>     llvm-svn: 332987<br>
><br>
> HTH,<br>
> Dan.<br>
><br>
> On Wed, 16 Sep 2020 at 09:37, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
> ><br>
> > Ping on this<br>
> ><br>
> > On Wed, Sep 9, 2020 at 8:27 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
> > ><br>
> > > The clang-cmake-armv8-lld (linaro-toolchain owners) buildbot is timing out trying to run some timeout tests (Dan Liew author):<br>
> > ><br>
> > > Pass: <a href="http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/5672" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/5672</a><br>
> > > Fail: <a href="http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/5673" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/5673</a><br>
> > ><br>
> > > Is there anything we can do to the buildbot? Or the tests? (bump up the time limits or maybe remove the tests as unreliable?)<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div></div>