Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6BF4310DAC for ; Tue, 27 May 2014 11:52:59 +0000 (UTC) Received: (qmail 86193 invoked by uid 500); 27 May 2014 11:52:56 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 86110 invoked by uid 500); 27 May 2014 11:52:56 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 86102 invoked by uid 99); 27 May 2014 11:52:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 May 2014 11:52:56 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tomasflobbe@gmail.com designates 209.85.215.50 as permitted sender) Received: from [209.85.215.50] (HELO mail-la0-f50.google.com) (209.85.215.50) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 May 2014 11:52:51 +0000 Received: by mail-la0-f50.google.com with SMTP id b8so6320192lan.23 for ; Tue, 27 May 2014 04:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=DElX44b4PwNN4hpHAV3FCVqSlZ3l6ZFD01ZbOsTWpmo=; b=oGxUKcFNwWOfD5aPQ9Y4Lz5FbDdlHi39Yr/Ei93eVGCJNWlHjE2WR9RtOLORoadnf1 GBH/uI4jTV6zGYNetOuJQJT3r+qDnzeNDgnvocUnmgB5CyShjIsK9qfkoafI/l3ii9BN 9k26kC6ZxQiQ4npulNLRkRTjEOPRd1D+WvOKWw8OJpCY8DckOPmNgGOevrp2WohhKRG3 fI3z33NFcnvIp1nmZ44Vz9UsR1GVNQ155NxvZ0Xl8Cla6hfH5DBAHSJDwvwX42jUb8E2 vEDkGyFanAzUj+1i9p8wSdMBT5NFGus+aAePOwfObl8PJim3yyNyd4qVO4y1nPJ3dXmg BIAA== MIME-Version: 1.0 X-Received: by 10.112.29.79 with SMTP id i15mr22145053lbh.26.1401191550133; Tue, 27 May 2014 04:52:30 -0700 (PDT) Received: by 10.112.122.226 with HTTP; Tue, 27 May 2014 04:52:30 -0700 (PDT) In-Reply-To: References: <538381C1.4060201@elyograg.org> Date: Tue, 27 May 2014 04:52:30 -0700 Message-ID: Subject: Re: How to Configure Solr For Test Purposes? From: =?UTF-8?B?VG9tw6FzIEZlcm7DoW5kZXogTMO2YmJl?= To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001a1133ed7a9bab6704fa605428 X-Virus-Checked: Checked by ClamAV on apache.org --001a1133ed7a9bab6704fa605428 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > What do you suggest for my purpose? If a test case fails re-running it fo= r > some times maybe a solution? What kind of configuration do you suggest fo= r > my Solr configuration? > > >From the snippet of test that you showed, it looks like it's testing only Solr functionality. So, first make sure this is a test that you really need. Solr has it's own tests, and it you feel it could use more (for some specific case or context), I'd open a Jira and try to get the test inside Solr. If my impression is wrong and your test is actually testing your code, then I'd suggest you to use a specific soft commit call with waitSearcher =3D tr= ue on your test instead of relying on the autocommit (and remove the autocommit completely from your solrconfig). Tom=C3=A1s Thanks; > Furkan KAMACI > 26 May 2014 21:03 tarihinde "Shawn Heisey" yazd=C4=B1= : > > > On 5/26/2014 10:57 AM, Furkan KAMACI wrote: > > > Hi; > > > > > > I run Solr within my Test Suite. I delete documents or atomically > update > > > them and check whether if it works or not. I know that I have to setu= p > a > > > hard/soft commit timing for my test Solr. However even I have that > > settings: > > > > > > > > > 1 > > > true > > > > > > > > > > > > 1 > > > > > > > I hope you know that this is BAD configuration. Doing automatic commit= s > > on an interval of 1 millisecond is asking for a whole host of problems. > > In some cases, this could do a commit after every single document that > > is indexed, which is NOT recommended at all. The openSearcher setting > > of "true" on autoCommit makes it even worse. There's no reason to do > > both autoSoftCommit and autoCommit with openSearcher=3Dtrue. I don't k= now > > which one "wins" between autoCommit and autoSoftCommit if they both hav= e > > the same config, but I would guess the hard commit does. > > > > > and even I wait (Thread.sleep()) for a time to wait Solr *sometimes* = my > > > tests are failed. I get fail error even I increase wait time. Exampl= e > > of a > > > sometimes failed code piece: > > > > > > for (int i =3D 0; i < dummyDocumentSize; i++) { > > > deleteById("id" + i); > > > dummyDocumentSize--; > > > queryResponse =3D query(solrParams); > > > assertTrue(queryResponse.getResults().size() =3D=3D > > dummyDocumentSize); > > > } > > > > > > at debug mode if I wait for Solr to reflect changes I see that I do n= ot > > get > > > error. What do you think, what kind of configuration I should have fo= r > > such > > > kind of purposes? > > > > Chances are that commits are going to take longer than 1 millisecond. > > If you're actively indexing, the system is going to be trying to stack > > up lots of commits at the same time. The maxWarmingSearchers value wil= l > > limit the number of new searchers that can be opened, but it will not > > stop the commits themselves. When lots of commits are going on, each > > one will take *even longer* to complete, which probably explains the > > problem. > > > > Thanks, > > Shawn > > > > > --001a1133ed7a9bab6704fa605428--