Return-Path: X-Original-To: apmail-lucenenet-commits-archive@www.apache.org Delivered-To: apmail-lucenenet-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1B22D1886B for ; Sat, 30 May 2015 19:10:56 +0000 (UTC) Received: (qmail 33451 invoked by uid 500); 30 May 2015 19:10:56 -0000 Delivered-To: apmail-lucenenet-commits-archive@lucenenet.apache.org Received: (qmail 33415 invoked by uid 500); 30 May 2015 19:10:55 -0000 Mailing-List: contact commits-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucenenet.apache.org Delivered-To: mailing list commits@lucenenet.apache.org Received: (qmail 33406 invoked by uid 99); 30 May 2015 19:10:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 May 2015 19:10:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C4A6CDFCDD; Sat, 30 May 2015 19:10:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: laimis@apache.org To: commits@lucenenet.apache.org Message-Id: <20274b810f7c4806a8182a1942b05e54@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: lucenenet git commit: more diagnostics for query utils Date: Sat, 30 May 2015 19:10:55 +0000 (UTC) Repository: lucenenet Updated Branches: refs/heads/failingtests 425325e23 -> 3a19ccb86 more diagnostics for query utils Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/3a19ccb8 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/3a19ccb8 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/3a19ccb8 Branch: refs/heads/failingtests Commit: 3a19ccb8672ac208c0396a47bf45a4d2de1e51ae Parents: 425325e Author: Laimonas Simutis Authored: Sat May 30 15:10:33 2015 -0400 Committer: Laimonas Simutis Committed: Sat May 30 15:10:33 2015 -0400 ---------------------------------------------------------------------- src/Lucene.Net.TestFramework/Search/QueryUtils.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3a19ccb8/src/Lucene.Net.TestFramework/Search/QueryUtils.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs index 3eae0af..e28fbfa 100644 --- a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs +++ b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs @@ -470,6 +470,7 @@ namespace Lucene.Net.Search float score = scorer.Score(); try { + var sb = new StringBuilder(); long startMS = Environment.TickCount; for (int i = LastDoc[0] + 1; i <= doc; i++) { @@ -478,7 +479,22 @@ namespace Lucene.Net.Search Assert.IsTrue(scorer_.Advance(i) != DocIdSetIterator.NO_MORE_DOCS, "query collected " + doc + " but skipTo(" + i + ") says no more docs!"); Assert.AreEqual(doc, scorer_.DocID(), "query collected " + doc + " but skipTo(" + i + ") got to " + scorer_.DocID()); float skipToScore = scorer_.Score(); - Assert.IsTrue(Math.Abs(skipToScore - scorer_.Score()) < MaxDiff, "unstable skipTo(" + i + ") score!"); + float secondScore = scorer_.Score(); + sb.AppendLine("Comparing equality:"); + sb.AppendLine(skipToScore.ToString()); + sb.AppendLine(secondScore.ToString()); + try + { + Assert.IsTrue(Math.Abs(skipToScore - secondScore) < MaxDiff, + "unstable skipTo(" + i + ") score!"); + } + catch (AssertionException ex) + { + Console.WriteLine("Failed. Collected output:"); + Console.WriteLine(sb.ToString()); + throw; + } + Assert.IsTrue(Math.Abs(score - skipToScore) < MaxDiff, "query assigned doc " + doc + " a score of <" + score + "> but skipTo(" + i + ") has <" + skipToScore + ">!"); // Hurry things along if they are going slow (eg