Skip to content

Fix for negative promotion calculation#237

Open
theobisproject wants to merge 1 commit into
chewiebug:developfrom
theobisproject:issue-235
Open

Fix for negative promotion calculation#237
theobisproject wants to merge 1 commit into
chewiebug:developfrom
theobisproject:issue-235

Conversation

@theobisproject
Copy link
Copy Markdown

Fixes #235

@codecov-io
Copy link
Copy Markdown

codecov-io commented Dec 8, 2019

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.46%. Comparing base (b583416) to head (f20ebd2).
⚠️ Report is 50 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #237      +/-   ##
=============================================
+ Coverage      70.43%   70.46%   +0.02%     
- Complexity      1518     1519       +1     
=============================================
  Files            145      145              
  Lines           8596     8597       +1     
  Branches        1389     1390       +1     
=============================================
+ Hits            6055     6058       +3     
+ Misses          1961     1958       -3     
- Partials         580      581       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- (event.getPreUsed() - event.getPostUsed())
);
int promo = (youngEvent.getPreUsed() - youngEvent.getPostUsed()) - (event.getPreUsed() - event.getPostUsed());
if (promo >= 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably only hide the error and still not produce correct promotion numbers.

"[12.034s][info][gc,phases ] GC(9) Evacuate Collection Set: 4.4ms\n" +
"[12.034s][info][gc,phases ] GC(9) Post Evacuate Collection Set: 0.5ms\n" +
"[12.034s][info][gc,phases ] GC(9) Other: 0.2ms\n" +
"[12.034s][info][gc,heap ] GC(9) Eden regions: 143->0(142)\n" +
Copy link
Copy Markdown

@cmoetzing cmoetzing Jan 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your test data is not correct. At least the parser does not read it correctly. If you add following lines top your test you will see that pre used of young is 0 but should be 143M.

assertThat("pre", model.get(0).getPreUsed(), is(162*1024)); // pass
assertThat("pre", model.get(0).getPostUsed(), is(19*1024)); // pass

AbstractGCEvent<?> event = model.get(0).getPhases().get(0);
assertThat("young pre", event.getGeneration(), is(AbstractGCEvent.Generation.YOUNG)); // pass
assertThat("young pre", event.getPreUsed(), is(143*1024)); // fail
assertThat("young pre", event.getPostUsed(), is(0L)); // pass

Your example would not produce the desired error if parsed correctly:

int young = 143 - 0; // 143
int all = 162 - 19; // 143
int promotion = young - all; // 0

The format in this test differs from the format used in your issue #235 that produces the error in "real life".

Edit: The formats are the same. The test does still not correctly parse the entry. Maybe it is missing some header like [0.011s][info][gc,heap] Heap region size: 1M?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Total promotion can get negative

3 participants