commit | 65c6a28c4143ff1253c6aa6c527fba538707297e | [log] [tgz] |
---|---|---|
author | Daniele Di Proietto <ddiproietto@google.com> | Thu Sep 22 14:54:26 2022 +0100 |
committer | Daniele Di Proietto <ddiproietto@google.com> | Fri Sep 23 14:47:29 2022 +0100 |
tree | 5af8284fcfef469a246b4d5682f6f1cd05fb29ac | |
parent | b2829a1f2f115581d5ab091770e7c1878c243b82 [diff] |
Clean producer and consumer env var between tests We have different types of integration tests: 1. Some talk to a system tracing service started by the test itself on a custom socket. E.g. src/tracing/test/api_integrationtest.cc 2. Some want to talk to the real system tracing service on android. E.g. test/android_integrationtest.cc Type 1 tests change PERFETTO_*_SOCK_NAME environment variables, in order to redirect consumer and producer to the "testing" service. They don't restore the previous values of the environment variables though. Today (by chance?) we execute type 2 tests before type 1 in perfetto_integrationtests. r.android.com/2203568 added a type 1 test that was executed before the type 2 tests. The type 2 tests started failing because suddenly they were redirected to the "testing" service instead of the real one, because the type 1 tests were leaking the environment variables. This commit fixes the problem by restoring the previous values for the environment variables on each test TearDown(). In one case (src/tracing/test/api_test_support.cc), this is not as straightforward, because the code caches the "testing" server among different test executions. Tested by running `atest perfetto_integrationtests` with or without r.android.com/2203568 Change-Id: I935d6a8fe964c039ad7f804ec1498466ba701a03
Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.
See https://perfetto.dev/docs or the /docs/ directory for documentation.