lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENE-4146) -Dtests.iters combined with -Dtestmethod never fails?
Date Fri, 15 Jun 2012 00:58:42 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-4146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Hoss Man updated LUCENE-4146:
-----------------------------

    Attachment: TEST-org.apache.lucene.TestSearch.no-iters-fail.xml
                TEST-org.apache.lucene.TestSearch.iters-no-fail.xml
                LUCENE-4146.fail.patch

trivial patch adding a test that is guaranteed to fail.

When run simply, it fails as expected...

{noformat}
hossman@bester:~/lucene/4x_dev/lucene/core$ ant test -Dtestcase=TestSearch -Dtestmethod=testFailure
Buildfile: /home/hossman/lucene/4x_dev/lucene/core/build.xml
...
test:
   [junit4] <JUnit4> says ¡Hola! Master seed: E9EE2618BEEE855E
   [junit4] Executing 1 suite with 1 JVM.
   [junit4] Suite: org.apache.lucene.TestSearch
   [junit4] FAILURE 0.14s | TestSearch.testFailure
   [junit4]    > Throwable #1: java.lang.AssertionError: This statement is false
   [junit4]    > 	at __randomizedtesting.SeedInfo.seed([E9EE2618BEEE855E:8153D5F484DEE7F1]:0)
   [junit4]    > 	at org.junit.Assert.fail(Assert.java:93)
   [junit4]    > 	at org.junit.Assert.assertTrue(Assert.java:43)
   [junit4]    > 	at org.apache.lucene.TestSearch.testFailure(TestSearch.java:39)
...
   [junit4]    > 
   [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestSearch -Dtests.method=testFailure
-Dtests.seed=E9EE2618BEEE855E -Dtests.locale=es_PA -Dtests.timezone=Pacific/Chatham -Dargs="-Dfile.encoding=UTF-8"
   [junit4]   2>
   [junit4]    > (@AfterClass output)
   [junit4]   2> NOTE: test params are: codec=Lucene40: {}, sim=RandomSimilarityProvider(queryNorm=false,coord=false):
{}, locale=es_PA, timezone=Pacific/Chatham
   [junit4]   2> NOTE: Linux 2.6.31-23-generic amd64/Sun Microsystems Inc. 1.6.0_24 (64-bit)/cpus=2,threads=1,free=105287320,total=124125184
   [junit4]   2> NOTE: All tests run in this JVM: [TestSearch]
   [junit4]   2> 
   [junit4] Completed in 0.37s, 1 test, 1 failure <<< FAILURES!
   [junit4]  
   [junit4] JVM J0:     0.53 ..     1.50 =     0.97s
   [junit4] Execution time total: 1.55 sec.
   [junit4] Tests summary: 1 suite, 1 test, 1 failure

BUILD FAILED
/home/hossman/lucene/4x_dev/lucene/common-build.xml:1019: The following error occurred while
executing this line:
/home/hossman/lucene/4x_dev/lucene/common-build.xml:745: There were test failures: 1 suite,
1 test, 1 failure

Total time: 5 seconds
hossman@bester:~/lucene/4x_dev/lucene/core$ cp ../build/core/test/TEST-org.apache.lucene.TestSearch.xml
~/tmp/TEST-org.apache.lucene.TestSearch.no-iters-fail.xml
{noformat}

However, when using -Dtests.iters, the test "passes" - but there's obvious record that it
even ran...

{noformat}
hossman@bester:~/lucene/4x_dev/lucene/core$ ant test -Dtests.iters=2 -Dtestcase=TestSearch
-Dtestmethod=testFailureBuildfile: /home/hossman/lucene/4x_dev/lucene/core/build.xml
...
test:
   [junit4] <JUnit4> says cześć. Master seed: 9BA05DE6F296F7C4
   [junit4] Executing 1 suite with 1 JVM.
   [junit4] Suite: org.apache.lucene.TestSearch
   [junit4] Completed in 0.07s, 0 tests
   [junit4]  
   [junit4] JVM J0:     0.73 ..     1.45 =     0.71s
   [junit4] Execution time total: 1.47 sec.
   [junit4] Tests summary: 1 suite, 0 tests
     [echo] 5 slowest tests:
 [tophints]   0.15s | org.apache.lucene.TestSearch

BUILD SUCCESSFUL
Total time: 5 seconds
hossman@bester:~/lucene/4x_dev/lucene/core$ cp ../build/core/test/TEST-org.apache.lucene.TestSearch.xml
~/tmp/TEST-org.apache.lucene.TestSearch.iters-no-fail.xml
{noformat}

(note in the XML file that it says no tests were run)
                
> -Dtests.iters combined with -Dtestmethod never fails?
> -----------------------------------------------------
>
>                 Key: LUCENE-4146
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4146
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Hoss Man
>         Attachments: LUCENE-4146.fail.patch, TEST-org.apache.lucene.TestSearch.iters-no-fail.xml,
TEST-org.apache.lucene.TestSearch.no-iters-fail.xml
>
>
> a test that is hardcoded to fail will report succes if you run it with -Dtests.iters

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message