Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport to 1.15: test: disable exact memory checks until we can sort out what changed in tcmalloc (#13447) #14165

Merged
merged 1 commit into from
Dec 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions test/common/stats/stat_test_utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,28 @@ MemoryTest::Mode MemoryTest::mode() {
const size_t end_mem = Memory::Stats::totalCurrentlyAllocated();
bool can_measure_memory = end_mem > start_mem;

// As of Oct 8, 2020, tcmalloc has changed such that Memory::Stats::totalCurrentlyAllocated
// is not deterministic, even with single-threaded tests. When possible, this should be fixed,
// and the following block of code uncommented. This affects approximate comparisons, not
// just exact ones.
#if 0
if (getenv("ENVOY_MEMORY_TEST_EXACT") != nullptr) { // Set in "ci/do_ci.sh" for 'release' tests.
RELEASE_ASSERT(can_measure_memory,
"$ENVOY_MEMORY_TEST_EXACT is set for canonical memory measurements, "
"but memory measurement looks broken");
return Mode::Canonical;
} else {
// Different versions of STL and other compiler/architecture differences may
// also impact memory usage, so when not compiling with MEMORY_TEST_EXACT,
// memory comparisons must be given some slack. There have recently emerged
// some memory-allocation differences between development and Envoy CI and
// Bazel CI (which compiles Envoy as a test of Bazel).
return can_measure_memory ? Mode::Approximate : Mode::Disabled;
#endif
// Different versions of STL and other compiler/architecture differences may
// also impact memory usage, so when not compiling with MEMORY_TEST_EXACT,
// memory comparisons must be given some slack. There have recently emerged
// some memory-allocation differences between development and Envoy CI and
// Bazel CI (which compiles Envoy as a test of Bazel).
return can_measure_memory ? Mode::Approximate : Mode::Disabled;
#if 0
}
#endif
#endif
}

Counter& TestStore::counterFromString(const std::string& name) {
Expand Down