{"action":"created","issue":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/10211","repository_url":"https://api.github.com/repos/hazelcast/hazelcast","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/10211/labels{/name}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/10211/comments","events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/10211/events","html_url":"https://github.com/hazelcast/hazelcast/pull/10211","id":218992309,"number":10211,"title":"Fixed assertion on same NearCacheStats instance","user":{"login":"Donnerbart","id":4196298,"avatar_url":"https://avatars0.githubusercontent.com/u/4196298?v=3","gravatar_id":"","url":"https://api.github.com/users/Donnerbart","html_url":"https://github.com/Donnerbart","followers_url":"https://api.github.com/users/Donnerbart/followers","following_url":"https://api.github.com/users/Donnerbart/following{/other_user}","gists_url":"https://api.github.com/users/Donnerbart/gists{/gist_id}","starred_url":"https://api.github.com/users/Donnerbart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Donnerbart/subscriptions","organizations_url":"https://api.github.com/users/Donnerbart/orgs","repos_url":"https://api.github.com/users/Donnerbart/repos","events_url":"https://api.github.com/users/Donnerbart/events{/privacy}","received_events_url":"https://api.github.com/users/Donnerbart/received_events","type":"User","site_admin":false},"labels":[{"id":137752575,"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Team:%20Core","name":"Team: Core","color":"109def","default":false},{"id":291006933,"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Type:%20Test-Failure","name":"Type: Test-Failure","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":{"login":"Donnerbart","id":4196298,"avatar_url":"https://avatars0.githubusercontent.com/u/4196298?v=3","gravatar_id":"","url":"https://api.github.com/users/Donnerbart","html_url":"https://github.com/Donnerbart","followers_url":"https://api.github.com/users/Donnerbart/followers","following_url":"https://api.github.com/users/Donnerbart/following{/other_user}","gists_url":"https://api.github.com/users/Donnerbart/gists{/gist_id}","starred_url":"https://api.github.com/users/Donnerbart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Donnerbart/subscriptions","organizations_url":"https://api.github.com/users/Donnerbart/orgs","repos_url":"https://api.github.com/users/Donnerbart/repos","events_url":"https://api.github.com/users/Donnerbart/events{/privacy}","received_events_url":"https://api.github.com/users/Donnerbart/received_events","type":"User","site_admin":false},"assignees":[{"login":"Donnerbart","id":4196298,"avatar_url":"https://avatars0.githubusercontent.com/u/4196298?v=3","gravatar_id":"","url":"https://api.github.com/users/Donnerbart","html_url":"https://github.com/Donnerbart","followers_url":"https://api.github.com/users/Donnerbart/followers","following_url":"https://api.github.com/users/Donnerbart/following{/other_user}","gists_url":"https://api.github.com/users/Donnerbart/gists{/gist_id}","starred_url":"https://api.github.com/users/Donnerbart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Donnerbart/subscriptions","organizations_url":"https://api.github.com/users/Donnerbart/orgs","repos_url":"https://api.github.com/users/Donnerbart/repos","events_url":"https://api.github.com/users/Donnerbart/events{/privacy}","received_events_url":"https://api.github.com/users/Donnerbart/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/87","html_url":"https://github.com/hazelcast/hazelcast/milestone/87","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/87/labels","id":2165710,"number":87,"title":"3.9","description":"","creator":{"login":"degerhz","id":8373100,"avatar_url":"https://avatars0.githubusercontent.com/u/8373100?v=3","gravatar_id":"","url":"https://api.github.com/users/degerhz","html_url":"https://github.com/degerhz","followers_url":"https://api.github.com/users/degerhz/followers","following_url":"https://api.github.com/users/degerhz/following{/other_user}","gists_url":"https://api.github.com/users/degerhz/gists{/gist_id}","starred_url":"https://api.github.com/users/degerhz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/degerhz/subscriptions","organizations_url":"https://api.github.com/users/degerhz/orgs","repos_url":"https://api.github.com/users/degerhz/repos","events_url":"https://api.github.com/users/degerhz/events{/privacy}","received_events_url":"https://api.github.com/users/degerhz/received_events","type":"User","site_admin":false},"open_issues":152,"closed_issues":218,"state":"open","created_at":"2016-11-30T08:32:28Z","updated_at":"2017-04-18T09:14:27Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2017-04-03T16:38:50Z","updated_at":"2017-04-18T10:23:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/10211","html_url":"https://github.com/hazelcast/hazelcast/pull/10211","diff_url":"https://github.com/hazelcast/hazelcast/pull/10211.diff","patch_url":"https://github.com/hazelcast/hazelcast/pull/10211.patch"},"body":"We had the following spurious failure in `com.hazelcast.client.map.impl.nearcache.ClientMapNearCacheTest.testNearCacheMaxIdleRecordsExpired[batchInvalidationEnabled:true]`:\r\n```\r\nwe expected to have all map entries in the Near Cache or already expired (NearCacheStatsImpl{ownedEntryCount=3530, ownedEntryMemoryCost=494200, creationTime=1491229736166, hits=0, misses=5000, ratio=0.0%, evictions=0, expirations=1469, lastPersistenceTime=0, persistenceCount=0, lastPersistenceDuration=0, lastPersistenceWrittenBytes=0, lastPersistenceKeyCount=0, lastPersistenceFailure=''})\r\n```\r\nhttps://hazelcast-l337.ci.cloudbees.com/job/new-lab-fast-pr/7972/testReport/junit/com.hazelcast.client.map.impl.nearcache/ClientMapNearCacheTest/testNearCacheMaxIdleRecordsExpired_batchInvalidationEnabled_true_/\r\n\r\nI think we have two issues with this test:\r\n\r\n* The `map.getLocalMapStats().getNearCacheStats()` always returns the same instance of the `NearCacheStatsImpl`. So it makes no sense to get a \"before something\" `NearCacheStats` and compare the same field with an instance which is fetched later. To fix this I've added a copy constructor to the `NearCacheStatsImpl` and fixed the tests accordingly. I've added the method `getNearCacheStatsCopy()` for convenient access.\r\n\r\n* The other issue is that two values in the stats are never updated in an atomic operation. In the test we have eviction enabled, so at some point in time we decrease the `ownedEntryCount` and increase the `evictionCount` after each other. We also read those two values after each other for the assert. So in the given failure we had a total value of 4999 instead of the wanted 5000. To fix this I used `assertTrueEventually()` to check for the summed value."},"comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments/294768110","html_url":"https://github.com/hazelcast/hazelcast/pull/10211#issuecomment-294768110","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/10211","id":294768110,"user":{"login":"Donnerbart","id":4196298,"avatar_url":"https://avatars0.githubusercontent.com/u/4196298?v=3","gravatar_id":"","url":"https://api.github.com/users/Donnerbart","html_url":"https://github.com/Donnerbart","followers_url":"https://api.github.com/users/Donnerbart/followers","following_url":"https://api.github.com/users/Donnerbart/following{/other_user}","gists_url":"https://api.github.com/users/Donnerbart/gists{/gist_id}","starred_url":"https://api.github.com/users/Donnerbart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Donnerbart/subscriptions","organizations_url":"https://api.github.com/users/Donnerbart/orgs","repos_url":"https://api.github.com/users/Donnerbart/repos","events_url":"https://api.github.com/users/Donnerbart/events{/privacy}","received_events_url":"https://api.github.com/users/Donnerbart/received_events","type":"User","site_admin":false},"created_at":"2017-04-18T10:23:03Z","updated_at":"2017-04-18T10:23:03Z","body":"run-lab-run"}}
{"actor":{"display_login":"Donnerbart"}}