{"action":"created","issue":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/4820","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/4820/labels{/name}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/4820/comments","events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/4820/events","html_url":"https://github.com/hazelcast/hazelcast/pull/4820","id":62379765,"number":4820,"title":"Fix for issue #3373.","user":{"login":"kobalski","id":3218140,"avatar_url":"https://avatars.githubusercontent.com/u/3218140?v=3","gravatar_id":"","url":"https://api.github.com/users/kobalski","html_url":"https://github.com/kobalski","followers_url":"https://api.github.com/users/kobalski/followers","following_url":"https://api.github.com/users/kobalski/following{/other_user}","gists_url":"https://api.github.com/users/kobalski/gists{/gist_id}","starred_url":"https://api.github.com/users/kobalski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kobalski/subscriptions","organizations_url":"https://api.github.com/users/kobalski/orgs","repos_url":"https://api.github.com/users/kobalski/repos","events_url":"https://api.github.com/users/kobalski/events{/privacy}","received_events_url":"https://api.github.com/users/kobalski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Type:%20Defect","name":"Type: Defect","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-17T12:12:50Z","updated_at":"2015-03-17T13:29:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/4820","html_url":"https://github.com/hazelcast/hazelcast/pull/4820","diff_url":"https://github.com/hazelcast/hazelcast/pull/4820.diff","patch_url":"https://github.com/hazelcast/hazelcast/pull/4820.patch"},"body":"System.currentTimeMillis() has non-monotonic behaviour, query test in hibernate is  failing in Nightly builds. Using sleepAtLeastSeconds() method in HazelcastTestSupport class instead of sleep() between each hibernate query in tests. Increasing sleep value did not solve issue #3373. sleepAtLeastSeconds() will make busy wait until 1 second has passed even though the test is running on a fast machine."},"comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments/82350273","html_url":"https://github.com/hazelcast/hazelcast/pull/4820#issuecomment-82350273","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/4820","id":82350273,"user":{"login":"Tembrel","id":237258,"avatar_url":"https://avatars.githubusercontent.com/u/237258?v=3","gravatar_id":"","url":"https://api.github.com/users/Tembrel","html_url":"https://github.com/Tembrel","followers_url":"https://api.github.com/users/Tembrel/followers","following_url":"https://api.github.com/users/Tembrel/following{/other_user}","gists_url":"https://api.github.com/users/Tembrel/gists{/gist_id}","starred_url":"https://api.github.com/users/Tembrel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tembrel/subscriptions","organizations_url":"https://api.github.com/users/Tembrel/orgs","repos_url":"https://api.github.com/users/Tembrel/repos","events_url":"https://api.github.com/users/Tembrel/events{/privacy}","received_events_url":"https://api.github.com/users/Tembrel/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T13:29:08Z","updated_at":"2015-03-17T13:29:08Z","body":"Looking at the implementation of sleepAtLeastMillis (on which\nsleepAtLeastSeconds depends):\n\nhttps://github.com/hazelcast/hazelcast/blob/e7d3d25abaaedda22678676783d2011dbb173d7f/hazelcast/src/test/java/com/hazelcast/test/HazelcastTestSupport.java#L174-L179\n\nWhy is this repeated 1ms sleep used instead of just\nTimeUnit.MILLISECONDS.sleep(millis)? Concern about spurious wakeups or\ninterruptions? That could be addressed; see Guava's uninterruptible sleep\nutility\n<http://docs.guava-libraries.googlecode.com/git-history/v18.0/javadoc/src-html/com/google/common/util/concurrent/Uninterruptibles.html#line.267>.\nAt the very least, use System.nanoTime instead of System.currentTimeMillis\n-- the latter (as was pointed out) is non-monotonic, the former *is*\n monotonic.\n\n--tim\n\nOn Tue, Mar 17, 2015 at 8:12 AM, İbrahim Gurses <notifications@github.com>\nwrote:\n\n> System.currentTimeMillis() has non-monotonic behaviour, query test in\n> hibernate is failing in Nightly builds. Using sleepAtLeastSeconds() method\n> in HazelcastTestSupport class instead of sleep() between each hibernate\n> query in tests. Increasing sleep value did not solve issue #3373\n> <https://github.com/hazelcast/hazelcast/issues/3373>.\n> sleepAtLeastSeconds() will make busy wait until 1 second has passed even\n> though the test is running on a fast machine.\n> ------------------------------\n> You can view, comment on, or merge this pull request online at:\n>\n>   https://github.com/hazelcast/hazelcast/pull/4820\n> Commit Summary\n>\n>    - System.currentTimeMillis() has non-monotonic behaviour,query test is\n>    failing in Nightly builds. sleepAtLeastSeconds() method added to\n>\n> File Changes\n>\n>    - *M*\n>    hazelcast-hibernate/hazelcast-hibernate3/src/test/java/com/hazelcast/hibernate/HibernateStatisticsTestSupport.java\n>    <https://github.com/hazelcast/hazelcast/pull/4820/files#diff-0> (2)\n>    - *M*\n>    hazelcast-hibernate/hazelcast-hibernate3/src/test/java/com/hazelcast/hibernate/HibernateTestSupport.java\n>    <https://github.com/hazelcast/hazelcast/pull/4820/files#diff-1> (3)\n>    - *M*\n>    hazelcast-hibernate/hazelcast-hibernate4/src/test/java/com/hazelcast/hibernate/HibernateStatisticsTestSupport.java\n>    <https://github.com/hazelcast/hazelcast/pull/4820/files#diff-2> (2)\n>    - *M*\n>    hazelcast-hibernate/hazelcast-hibernate4/src/test/java/com/hazelcast/hibernate/HibernateTestSupport.java\n>    <https://github.com/hazelcast/hazelcast/pull/4820/files#diff-3> (3)\n>\n> Patch Links:\n>\n>    - https://github.com/hazelcast/hazelcast/pull/4820.patch\n>    - https://github.com/hazelcast/hazelcast/pull/4820.diff\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/hazelcast/hazelcast/pull/4820>.\n>\n"}}