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 EE0AF200C2A for ; Wed, 1 Mar 2017 11:43:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id ECC22160B78; Wed, 1 Mar 2017 10:43:51 +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 3DE8E160B5E for ; Wed, 1 Mar 2017 11:43:51 +0100 (CET) Received: (qmail 79306 invoked by uid 500); 1 Mar 2017 10:43:50 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 79293 invoked by uid 99); 1 Mar 2017 10:43:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Mar 2017 10:43:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 5E9FCC0E6B for ; Wed, 1 Mar 2017 10:43:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.651 X-Spam-Level: X-Spam-Status: No, score=0.651 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id l86uGQwH1ENi for ; Wed, 1 Mar 2017 10:43:48 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 050EF618A4 for ; Wed, 1 Mar 2017 10:43:48 +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 F3435E0AF9 for ; Wed, 1 Mar 2017 10:43:46 +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 EADC224184 for ; Wed, 1 Mar 2017 10:43:45 +0000 (UTC) Date: Wed, 1 Mar 2017 10:43:45 +0000 (UTC) From: "Balint Molnar (JIRA)" To: dev@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work stopped] (KAFKA-1954) Speed Up The Unit Tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 01 Mar 2017 10:43:52 -0000 [ https://issues.apache.org/jira/browse/KAFKA-1954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Work on KAFKA-1954 stopped by Balint Molnar. -------------------------------------------- > Speed Up The Unit Tests > ----------------------- > > Key: KAFKA-1954 > URL: https://issues.apache.org/jira/browse/KAFKA-1954 > Project: Kafka > Issue Type: Improvement > Reporter: Jay Kreps > Assignee: Balint Molnar > Labels: newbie++ > Attachments: KAFKA-1954.patch > > > The server unit tests are pretty slow. They take about 8m40s on my machine. Combined with slow scala compile time this is kind of painful. > Almost all of this time comes from the integration tests which start one or more brokers and then shut them down. > Our finding has been that these integration tests are actually quite useful so we probably can't just get rid of them. > Here are some times: > Zk startup: 100ms > Kafka server startup: 600ms > Kafka server shutdown: 500ms > > So you can see that an integration test suite with 10 tests that starts and stops a 3 node cluster for each test will take ~34 seconds even if the tests themselves are instantaneous. > I think the best solution to this is to get the test harness classes in shape and then performance tune them a bit as this would potentially speed everything up. There are several test harness classes: > - ZooKeeperTestHarness > - KafkaServerTestHarness > - ProducerConsumerTestHarness > - IntegrationTestHarness (similar to ProducerConsumerTestHarness but using new clients) > Unfortunately often tests don't use the right harness, they often use a lower-level harness than they should and manually create stuff. Usually the cause of this is that the harness is missing some feature. > I think the right thing to do here is > 1. Get the tests converted to the best possible harness. If you are testing producers and consumers then you should use the harness that creates all that and shuts it down for you. > 2. Optimize the harnesses to be faster. > How can we optimize the harnesses? I'm not sure, I would solicit ideas. Here are a few: > 1. It's worth analyzing the logging to see what is taking up time in the startup and shutdown. > 2. There may be things like controlled shutdown that we can disable (since we are anyway going to discard the brokers after shutdown. > 3. The harnesses could probably start all the servers and all the clients in parallel. > 4. We maybe able to tune down the resource usage in the server config for test cases a bit. -- This message was sent by Atlassian JIRA (v6.3.15#6346)