[
https://issues.apache.org/jira/browse/SOLR-7877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14658634#comment-14658634
]
Christine Poerschke commented on SOLR-7877:
-------------------------------------------
TestAuthenticationFramework overrides the {{testBasics}} method but does not
override the {{testCollectionCreateWithoutCoresThenDelete}} method. Would this
mean that if testCollectionCreateWithoutCoresThenDelete runs after testBasics
the former is bound to fail because it will use the requestUsername and
requestPassword last set by the latter?
{code}
public class TestAuthenticationFramework extends TestMiniSolrCloudCluster {
...
static String requestUsername = MockAuthenticationPlugin.expectedUsername;
static String requestPassword = MockAuthenticationPlugin.expectedPassword;
...
@Test
@Override
public void testBasics() throws Exception {
requestUsername = MockAuthenticationPlugin.expectedUsername;
requestPassword = MockAuthenticationPlugin.expectedPassword;
final String collectionName = "testAuthenticationFrameworkCollection";
// Should pass
testCollectionCreateSearchDelete(collectionName);
requestUsername = MockAuthenticationPlugin.expectedUsername;
requestPassword = "junkpassword";
// Should fail with 401
try {
testCollectionCreateSearchDelete(collectionName);
fail("Should've returned a 401 error");
} catch (Exception ex) {
if (!ex.getMessage().contains("Error 401")) {
fail("Should've returned a 401 error");
}
}
}
{code}
> TestAuthenticationFramework test failures
> -----------------------------------------
>
> Key: SOLR-7877
> URL: https://issues.apache.org/jira/browse/SOLR-7877
> Project: Solr
> Issue Type: Bug
> Affects Versions: 5.3, Trunk
> Reporter: Noble Paul
> Priority: Blocker
>
> {code}
> Build: http://jenkins.thetaphi.de/job/Lucene-Solr-trunk-Linux/13742/
> Java: 32bit/jdk1.8.0_60-ea-b24 -server -XX:+UseG1GC
> 1 tests failed.
> FAILED:
> org.apache.solr.cloud.TestAuthenticationFramework.testCollectionCreateWithoutCoresThenDelete
> Error Message:
> Error from server at http://127.0.0.1:51573/solr: Expected mime type
> application/octet-stream but got text/html. <html> <head> <meta
> http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
> <title>Error 401 </title> </head> <body> <h2>HTTP ERROR: 401</h2> <p>Problem
> accessing /solr/admin/collections. Reason: <pre> Unauthorized
> request</pre></p> <hr /><i><small>Powered by Jetty://</small></i> </body>
> </html>
> Stack Trace:
> org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error
> from server at http://127.0.0.1:51573/solr: Expected mime type
> application/octet-stream but got text/html. <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
> <title>Error 401 </title>
> </head>
> <body>
> <h2>HTTP ERROR: 401</h2>
> <p>Problem accessing /solr/admin/collections. Reason:
> <pre> Unauthorized request</pre></p>
> <hr /><i><small>Powered by Jetty://</small></i>
> </body>
> </html>
> at
> __randomizedtesting.SeedInfo.seed([A454441B503006EB:17918BDA5F48D5AA]:0)
> at
> org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:528)
> at
> org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:234)
> at
> org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:226)
> at
> org.apache.solr.client.solrj.impl.LBHttpSolrClient.doRequest(LBHttpSolrClient.java:376)
> at
> org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:328)
> at
> org.apache.solr.client.solrj.impl.CloudSolrClient.sendRequest(CloudSolrClient.java:1086)
> at
> org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:856)
> at
> org.apache.solr.client.solrj.impl.CloudSolrClient.request(CloudSolrClient.java:799)
> at
> org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1220)
> at
> org.apache.solr.cloud.MiniSolrCloudCluster.makeCollectionsRequest(MiniSolrCloudCluster.java:349)
> at
> org.apache.solr.cloud.MiniSolrCloudCluster.createCollection(MiniSolrCloudCluster.java:333)
> at
> org.apache.solr.cloud.TestMiniSolrCloudCluster.createCollection(TestMiniSolrCloudCluster.java:115)
> at
> org.apache.solr.cloud.TestMiniSolrCloudCluster.testCollectionCreateWithoutCoresThenDelete(TestMiniSolrCloudCluster.java:298)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]