Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 145E2200C6E for ; Mon, 8 May 2017 23:55:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 12E45160BA5; Mon, 8 May 2017 21:55:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5A55F160BA2 for ; Mon, 8 May 2017 23:55:10 +0200 (CEST) Received: (qmail 17701 invoked by uid 500); 8 May 2017 21:55:09 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 17690 invoked by uid 99); 8 May 2017 21:55:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 May 2017 21:55:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 1EF771A02B2 for ; Mon, 8 May 2017 21:55:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id sciEquVAGbhV for ; Mon, 8 May 2017 21:55:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 105CB5FDBE for ; Mon, 8 May 2017 21:55:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E4526E0D2F for ; Mon, 8 May 2017 21:55:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 6C05E21DFE for ; Mon, 8 May 2017 21:55:04 +0000 (UTC) Date: Mon, 8 May 2017 21:55:04 +0000 (UTC) From: "Michael Kjellman (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-13216) testall failure in org.apache.cassandra.net.MessagingServiceTest.testDroppedMessages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 08 May 2017 21:55:11 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16001619#comment-16001619 ] Michael Kjellman commented on CASSANDRA-13216: ---------------------------------------------- With this change, the "mocked" Clock in MessagingServiceTest will always return 0 for getTick() {code} private static long time = System.currentTimeMillis(); private static Clock clock = new Clock() { public long getTick() { return 0; } public long getTime() { return time; } }; {code} But if we look at the implementation of time() in metrics-core Timer, it does the following: {code} /** * Times and records the duration of event. * * @param event a {@link Callable} whose {@link Callable#call()} method implements a process * whose duration should be timed * @param the type of the value returned by {@code event} * @return the value returned by {@code event} * @throws Exception if {@code event} throws an {@link Exception} */ public T time(Callable event) throws Exception { final long startTime = clock.getTick(); try { return event.call(); } finally { update(clock.getTick() - startTime); } } {code} So, from my understanding this means we will always just do 0-0 for the update() call on the Timer... right? However, I don't think any of this matters in retospect. Took a big step back and looked over the actual unit test and what this thing is testing with [~jjirsa] and [~jasobrown] and all 3 of us think this magic number a bit questionable. If we look at the original patch that added these magic numbers in the first place for CASSANDRA-10580 (https://github.com/pcmanus/cassandra/commit/c9ef25fd81501005b6484baf064081efc557f3f4) there is nothing in the ticket or test or commit that justifies testing for these magic numbers and it looks like this is just going to be dependent on how fast your system can iterate thru the logic 5000 times. So: I'd like to propose that we throw away the 2nd assert in this test. The first and last are good (counting the number that we expect to get) but doing a literal string compare on the entire log message is kinda unhelpful. Instead, we should throw a regex here on the log message, parse out the times and just check that they are > 0. Thoughts? > testall failure in org.apache.cassandra.net.MessagingServiceTest.testDroppedMessages > ------------------------------------------------------------------------------------ > > Key: CASSANDRA-13216 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13216 > Project: Cassandra > Issue Type: Bug > Components: Testing > Reporter: Sean McCarthy > Assignee: Alex Petrov > Labels: test-failure, testall > Fix For: 3.0.x, 3.11.x, 4.x > > Attachments: TEST-org.apache.cassandra.net.MessagingServiceTest.log, TEST-org.apache.cassandra.net.MessagingServiceTest.log > > > example failure: > http://cassci.datastax.com/job/cassandra-3.11_testall/81/testReport/org.apache.cassandra.net/MessagingServiceTest/testDroppedMessages > {code} > Error Message > expected:<... dropped latency: 27[30 ms and Mean cross-node dropped latency: 2731] ms> but was:<... dropped latency: 27[28 ms and Mean cross-node dropped latency: 2730] ms> > {code}{code} > Stacktrace > junit.framework.AssertionFailedError: expected:<... dropped latency: 27[30 ms and Mean cross-node dropped latency: 2731] ms> but was:<... dropped latency: 27[28 ms and Mean cross-node dropped latency: 2730] ms> > at org.apache.cassandra.net.MessagingServiceTest.testDroppedMessages(MessagingServiceTest.java:83) > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org