This is an archive of the discontinued LLVM Phabricator instance.

[Test][Time profiler] Fix test time checking
ClosedPublic

Authored by anton-afanasyev on Aug 24 2021, 6:36 AM.

Details

Summary

This test sometimes triggers failures during build testing. For instance, see:
https://lab.llvm.org/buildbot/#/builders/52/builds/10161, details: https://lab.llvm.org/buildbot/#/builders/52/builds/10161/steps/5/logs/FAIL__Clang__check-time-trace-sections_cpp .
AFAICT the time between driver calling and checking its time tracker output
is not guaranteed to be stable and small:

> head -2 check-time-trace-sections.cpp
// RUN: %clangxx -S -ftime-trace -ftime-trace-granularity=0 -o %T/check-time-trace-sections %s
// RUN: cat %T/check-time-trace-sections.json | %python %S/check-time-trace-sections.py
> clang -S -ftime-trace -ftime-trace-granularity=0 -o /tmp/check check-time-trace-sections.cpp
> cat /tmp/check.json | python check-time-trace-sections.py
> sleep 10
> cat /tmp/check.json | python check-time-trace-sections.py
'beginningOfTime' should represent the absolute time when the process has started
>

The attribute beginningOfTime was introduced here: https://reviews.llvm.org/D78030
One can change "10 sec" value to something longer, but I believe
it's enough just to check that beginningOfTime exists and is
not later than current time.

Diff Detail

Event Timeline

anton-afanasyev requested review of this revision.Aug 24 2021, 6:36 AM
anton-afanasyev created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2021, 6:36 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
anton-afanasyev edited the summary of this revision. (Show Details)Aug 24 2021, 6:42 AM
lebedev.ri accepted this revision.Aug 30 2021, 3:53 AM

Everything timing-based is pretty much guaranteed to be flaky.

This revision is now accepted and ready to land.Aug 30 2021, 3:53 AM
This revision was landed with ongoing or failed builds.Aug 31 2021, 11:12 PM
This revision was automatically updated to reflect the committed changes.