Skip to content

Commit

Permalink
Force a GC before taking the final histogram in t test_aspect_and_con…
Browse files Browse the repository at this point in the history
…figured_target_cleared. Even though the histogram should be doing a GC (because of -histo:live), occasionally a stale aspect object can evade it.

PiperOrigin-RevId: 241879702
  • Loading branch information
janakdr authored and Copybara-Service committed Apr 4, 2019
1 parent d521964 commit d3ce720
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/shell/integration/discard_analysis_cache_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ EOF
|| fail "Expected success"
[[ -e "bazel-bin/foo/foo.out.aspect" ]] || fail "Aspect foo not run"
[[ -e "bazel-bin/foo/dep.out.aspect" ]] || fail "Aspect bar not run"
# Make sure to clear out garbage, sometimes a spare aspect hangs around.
bazel info used-heap-size-after-gc >& /dev/null
"$bazel_javabase"/bin/jmap -histo:live "$server_pid" > histo.txt
cat histo.txt >> "$TEST_log"
ct_count="$(extract_histogram_count histo.txt 'RuleConfiguredTarget$')"
Expand Down

0 comments on commit d3ce720

Please sign in to comment.