|
|
DescriptionClean up g_memory_coordinator after each MemoryCoordinatorImpl test
MemoryCoordinatorImpl tests fail the first time and should be re-run separately.
g_memory_coordinator need to be cleaned up between tests, otherwise the subsequent tests
will crash trying to reset g_memory_coordinator.
This CL implements reset method which called after each MemoryCoordinatorImpl in destructor.
BUG=698282
Review-Url: https://codereview.chromium.org/2726983006
Cr-Commit-Position: refs/heads/master@{#454926}
Committed: https://chromium.googlesource.com/chromium/src/+/aba30978d6c58a937eb2cf5fbdcde3e2abb7cfaa
Patch Set 1 #
Total comments: 4
Patch Set 2 : Allow SetMemoryCoordinator to nullify #
Messages
Total messages: 21 (8 generated)
Description was changed from ========== Clean up g_memory_coordinator after each MemoryCoordinatorImpl test MemoryCoordinatorImpl tests fail the first time and should be re-run separately. g_memory_coordinator need to be cleaned up between tests, otherwise the subsequent tests will crash trying to reset g_memory_coordinator. This CL implements reset method which called after each MemoryCoordinatorImpl in destructor. BUG=698282 ========== to ========== Clean up g_memory_coordinator after each MemoryCoordinatorImpl test MemoryCoordinatorImpl tests fail the first time and should be re-run separately. g_memory_coordinator need to be cleaned up between tests, otherwise the subsequent tests will crash trying to reset g_memory_coordinator. This CL implements reset method which called after each MemoryCoordinatorImpl in destructor. BUG=698282 ==========
sadrul@chromium.org changed reviewers: + sadrul@chromium.org
https://codereview.chromium.org/2726983006/diff/1/content/browser/memory/memo... File content/browser/memory/memory_coordinator_impl.cc (right): https://codereview.chromium.org/2726983006/diff/1/content/browser/memory/memo... content/browser/memory/memory_coordinator_impl.cc:180: base::MemoryCoordinatorProxy::ResetGlobals(); Maybe this could just call: base::MemoryCoordinatorProxy::SetMemoryCoordinator(nullptr)? and SetMemoryCoordinator() could be updated to allow this?
dimaa@chromium.org changed reviewers: + hajimehoshi@chromium.org
https://codereview.chromium.org/2726983006/diff/1/content/browser/memory/memo... File content/browser/memory/memory_coordinator_impl.cc (right): https://codereview.chromium.org/2726983006/diff/1/content/browser/memory/memo... content/browser/memory/memory_coordinator_impl.cc:180: base::MemoryCoordinatorProxy::ResetGlobals(); On 2017/03/03 17:40:41, sadrul wrote: > Maybe this could just call: > base::MemoryCoordinatorProxy::SetMemoryCoordinator(nullptr)? > > and SetMemoryCoordinator() could be updated to allow this? These tests are failing because we execute this method when globals are not reseted. We are getting crash because of the line "DCHECK(!g_memory_coordinator);" inside that method. That is why we need to use different way to reset it.
https://codereview.chromium.org/2726983006/diff/1/content/browser/memory/memo... File content/browser/memory/memory_coordinator_impl.cc (right): https://codereview.chromium.org/2726983006/diff/1/content/browser/memory/memo... content/browser/memory/memory_coordinator_impl.cc:180: base::MemoryCoordinatorProxy::ResetGlobals(); On 2017/03/03 18:30:05, dimaa1 wrote: > On 2017/03/03 17:40:41, sadrul wrote: > > Maybe this could just call: > > base::MemoryCoordinatorProxy::SetMemoryCoordinator(nullptr)? > > > > and SetMemoryCoordinator() could be updated to allow this? > > These tests are failing because we execute this method when globals are not > reseted. We are getting crash because of the line > "DCHECK(!g_memory_coordinator);" inside that method. That is why we need to use > different way to reset it. Yep. That's what I suggested SetMemoryCoordinator() would need to also be updated. For example, instead of: DCHECK(!g_memory_coordinator); it could check: DCHECK(!g_memory_coordinator || !coordinator); i.e. you can unset the global coordinator, but cannot replace the global coordinator with another one. Which is the behaviour we want.
https://codereview.chromium.org/2726983006/diff/1/content/browser/memory/memo... File content/browser/memory/memory_coordinator_impl.cc (right): https://codereview.chromium.org/2726983006/diff/1/content/browser/memory/memo... content/browser/memory/memory_coordinator_impl.cc:180: base::MemoryCoordinatorProxy::ResetGlobals(); On 2017/03/03 18:45:01, sadrul wrote: > On 2017/03/03 18:30:05, dimaa1 wrote: > > On 2017/03/03 17:40:41, sadrul wrote: > > > Maybe this could just call: > > > base::MemoryCoordinatorProxy::SetMemoryCoordinator(nullptr)? > > > > > > and SetMemoryCoordinator() could be updated to allow this? > > > > These tests are failing because we execute this method when globals are not > > reseted. We are getting crash because of the line > > "DCHECK(!g_memory_coordinator);" inside that method. That is why we need to > use > > different way to reset it. > > Yep. That's what I suggested SetMemoryCoordinator() would need to also be > updated. For example, instead of: > > DCHECK(!g_memory_coordinator); > > it could check: > > DCHECK(!g_memory_coordinator || !coordinator); > > i.e. you can unset the global coordinator, but cannot replace the global > coordinator with another one. Which is the behaviour we want. Great idea!
cool! non-owner lgtm
hajimehoshi@chromium.org changed reviewers: + bashi@chromium.org
+bashi
lgtm. Thanks for the fix!
non-owner lgtm
dimaa@chromium.org changed reviewers: + mark@chromium.org
mark@chromium.org: Please review changes in base/memory/memory_coordinator_proxy.cc
LGTM
The CQ bit was checked by dimaa@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 20001, "attempt_start_ts": 1488826222396380, "parent_rev": "e8cf2b3e52941a3d8cd632908dbd81a4a7b02470", "commit_rev": "aba30978d6c58a937eb2cf5fbdcde3e2abb7cfaa"}
Message was sent while issue was closed.
Description was changed from ========== Clean up g_memory_coordinator after each MemoryCoordinatorImpl test MemoryCoordinatorImpl tests fail the first time and should be re-run separately. g_memory_coordinator need to be cleaned up between tests, otherwise the subsequent tests will crash trying to reset g_memory_coordinator. This CL implements reset method which called after each MemoryCoordinatorImpl in destructor. BUG=698282 ========== to ========== Clean up g_memory_coordinator after each MemoryCoordinatorImpl test MemoryCoordinatorImpl tests fail the first time and should be re-run separately. g_memory_coordinator need to be cleaned up between tests, otherwise the subsequent tests will crash trying to reset g_memory_coordinator. This CL implements reset method which called after each MemoryCoordinatorImpl in destructor. BUG=698282 Review-Url: https://codereview.chromium.org/2726983006 Cr-Commit-Position: refs/heads/master@{#454926} Committed: https://chromium.googlesource.com/chromium/src/+/aba30978d6c58a937eb2cf5fbdcd... ==========
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/aba30978d6c58a937eb2cf5fbdcd... |