commit | cc28cbfb68ca983b08773039e2938d9f5d296584 | [log] [tgz] |
---|---|---|
author | Ryan Savitski <rsavitski@google.com> | Fri Nov 09 22:55:12 2018 +0000 |
committer | Ryan Savitski <rsavitski@google.com> | Fri Nov 09 22:57:39 2018 +0000 |
tree | b6ba809002e4a6a2ce38a07f8d60c70a32941d31 | |
parent | 1ba4ba601cc4489b167b06b16e767ba39a43fdbd [diff] |
Deflake TracingServiceImplTest.WriteIntoFileAndStopOnMaxSize. The test was asserting the wrong properties and passing for the wrong reasons. It independently checked that: (a) there's at least 10 packets in the file, (b) a prefix of the test packets has the expected payloads (but not that all test packets are accounted for). What was happening in practice is that in the passing case, the 512 bytes were filled with the 4 preamble packets (sync marker, clock snapshot, trace stats, trace config), followed by 6 (out of 10 expected) test packets. The test became flaky as that combined size of these 10 packets became very close to 512 bytes in practice, s.t. sometimes the 6th test packet could not fit (-> there would only be 9 packets in the file). A possible explanation of why the issue manifested as being timing dependent - varint encoding of timestamps, slower test execution -> over the threshold for fitting the 10th packet in 512 bytes. I've decided to assert the number of preamble packets strictly (making this a bit of a change-detector test), erring on the side of eager and obvious failures if someone changes the preamble format significantly. (Credit for most of the debugging goes to Lalit) Change-Id: I13951dc4756d76327a1bbf611828fe5c91201700
Perfetto is an open-source project for performance instrumentation and tracing of Linux/Android/Chrome platforms and user-space apps.
See www.perfetto.dev for docs.