This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Add "REQUIRES: long_tests" to two libc++ tests
AbandonedPublic

Authored by miyuki on Jun 8 2023, 6:01 AM.

Details

Reviewers
ldionne
Mordante
Group Reviewers
Restricted Project
Summary

Currently, we use the lit feature "long_tests" for libc++ tests that
take a long time to run so that they can be disabled by users.

This patch marks the following two tests:

  • std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp
  • numerics/rand/rand.dist/rand.dist.bern/rand.dist.bern.bin/eval.PR44847.pass.cpp

with "REQUIRES: long_tests".

The run time of these tests is similar to that of other tests already
marked as "long_tests". For example, on an x86-64 machine with an
i7-6700 CPU running at 3.4 GHz, an existing long test
std/numerics/rand/rand.dist/rand.dist.pois/rand.dist.pois.weibull/eval_param.pass.cpp
takes 1.07 seconds, whereas eval.PR44847.pass.cpp takes 1.27 seconds,
sort.pass.cpp takes 39.10 seconds.

Diff Detail

Event Timeline

miyuki created this revision.Jun 8 2023, 6:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2023, 6:01 AM
Herald added a subscriber: pengfei. · View Herald Transcript
miyuki requested review of this revision.Jun 8 2023, 6:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2023, 6:01 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik added a subscriber: philnik.Jun 8 2023, 8:46 AM

I'm really not convinced that this flag makes any sense. Most importantly: A test on one machine could be very slow while it's negligible on another. Some tests that are marked long_tests take ~0.5 seconds on my machine, which is definitely not slow. Just having a timeout and the option to ignore timeouts in lit would make a lot more sense IMO.

miyuki added a comment.Jun 8 2023, 8:58 AM

A test on one machine could be very slow while it's negligible on another. Some tests that are marked long_tests take ~0.5 seconds on my machine, which is definitely not slow.

Yes, I am running these tests on a simulator and eval.PR44847.pass.cpp takes ~10 minutes. I used x86 as an example because that's what others can use to reproduce the result.

Just having a timeout and the option to ignore timeouts in lit would make a lot more sense IMO.

But that would hide real bugs, e.g. miscompilations that create infinite loops.

A test on one machine could be very slow while it's negligible on another. Some tests that are marked long_tests take ~0.5 seconds on my machine, which is definitely not slow.

Yes, I am running these tests on a simulator and eval.PR44847.pass.cpp takes ~10 minutes. I used x86 as an example because that's what others can use to reproduce the result.

Just having a timeout and the option to ignore timeouts in lit would make a lot more sense IMO.

But that would hide real bugs, e.g. miscompilations that create infinite loops.

Possibly, but these tests are for the library, not the compiler. Anyways, you can still keep a list of tests that time out and check that there isn't anything unexpected timing out. Given that the list of slow tests can be different on every platform, I don't see how we could keep a reasonable list of slow tests without losing coverage. Another option I just remembered is that you can disable specific tests through --filter-out.

miyuki abandoned this revision.Jun 9 2023, 5:45 AM