Commit Graph

823 Commits

Author SHA1 Message Date
Erick Erickson a79a90dcd3 SOLR-11035: (at least) 2 distinct failures possible when clients attempt searches during SolrCore reload
(cherry picked from commit 292bed0c42)
2020-02-21 10:58:37 -05:00
Chris Hostetter ea20c9a001 SOLR-13794: Replace redundent test only copy of '_default' configset with SolrTestCase logic to correctly set 'solr.default.confdir' system property
This change allows us to remove kludgy test only code from ZkController

(cherry picked from commit f549ee3535)
2020-02-14 12:00:13 -07:00
Shalin Shekhar Mangar 78e567c57e SOLR-13996: Refactor HttpShardHandler.prepDistributed method (#1220)
SOLR-13996: Refactor HttpShardHandler.prepDistributed method into smaller pieces

This commit introduces an interface named ReplicaSource which is marked as experimental. It has two sub-classes named CloudReplicaSource (for solr cloud) and LegacyReplicaSource for non-cloud clusters. The prepDistributed method now calls out to these sub-classes depending on whether the cluster is running on cloud mode or not.

(cherry picked from commit c65b97665c)
2020-02-10 20:02:08 +05:30
Robert Muir 0cc67223a8
SOLR-14217: tests respect tests.workDir correctly (prevent SSD destruction) 2020-01-29 13:44:51 -05:00
Shalin Shekhar Mangar 0dea3c7060 SOLR-14207: Fix logging statements with less or more arguments than placeholders
(cherry picked from commit 04193d5252)
2020-01-23 14:00:58 +05:30
David Smiley baab2fce43
SOLR-14040: shareSchema support for SolrCloud
* Use Caffeine impl and weak values (to the schema). Previously the cache never evicted!
* now populating the configSet name from ZK into CloudDescriptor when CloudDescriptor is loaded
* actual schema name needs to be deterministic now; fallback from non-existent managed-schema to schema.xml will thwart this cache
* a test conf/core.properties wasn't actually used and became a problem in it's weird location after I refactored some logic

Closes #1166
(cherry picked from commit ab924fd4ea)
2020-01-21 13:40:14 -05:00
Chris Hostetter bb48773cdc SOLR-14184: Internal 'test' variable DirectUpdateHandler2.commitOnClose has been removed and replaced with TestInjection.skipIndexWriterCommitOnClose
(cherry picked from commit 5f2d7c4855)
2020-01-16 11:47:36 -07:00
Kevin Risden 3f23002456
SOLR-14106: Cleanup Jetty SslContextFactory usage
Jetty 9.4.16.v20190411 and up introduced separate
client and server SslContextFactory implementations.
This split requires the proper use of of
SslContextFactory in clients and server configs.

This fixes the following
* SSL with SOLR_SSL_NEED_CLIENT_AUTH not working since v8.2.0
* Http2SolrClient SSL not working in branch_8x

Signed-off-by: Kevin Risden <krisden@apache.org>
2019-12-19 23:19:12 -05:00
Robert Muir 04e306f616 SOLR-14085: remove solr fork of lucene test securitymanager 2019-12-18 23:12:57 -05:00
Chris Hostetter f0714517e4 SOLR-14099: expanded comment on static final variable based on followup questions in Jira from Dawid
(cherry picked from commit d30f90e349)
2019-12-18 16:38:36 -07:00
Chris Hostetter d1fa6e1e02 SOLR-14099: Fixed @LogLevel annotation in test-framework to correctly 'unset' Loggers after test
(cherry picked from commit cc4262a8ec)
2019-12-17 14:59:26 -07:00
Ishan Chattopadhyaya 72b3c54e7d SOLR-14071: Untrusted configsets shouldn't be allowed to use <lib> directive 2019-12-12 15:01:06 +05:30
Robert Muir 715b2151ac SOLR-14050: clean up tests use of network addresses
Solr tests now have a similar policy to Lucene, loopback use only. If a
test tries to resolve or connect to the internet, it will get SecurityException.

Some solr tests explicitly try to talk to dead nodes with real
networking. This is not good and asking for trouble, but use low loopback port numbers instead of
multicast addresses. The idea is that it fails faster. Move these to
constants so that stuff isn't copy-pasted everywhere, in case we have to
do something different later.
2019-12-11 13:27:03 -05:00
Kevin Risden d4882891df
SOLR-14033: Fix Hadoop tests with security manager
This removes the Solr security manager hacks
for Hadoop. It does so by:
* Using a fake group mapping class instead of ShellGroupMapping
* Copies a few Hadoop classes and modifies them for tests with no Shell
* Nulls out some of the static variables in the tests

The Hadoop files were copied from Apache Hadoop 3.2.0
and copied to the test package to be only picked up
during tests. They were modified to remove the need to
shell out for access. The assumption is that these
HDFS integration tests only run on Unix based systems
and therefore Windows compatibility was removed in some
of the modified classes. The long term goal is to remove
these custom Hadoop classes. All the copied classes are
in the org.apache.hadoop package.

Signed-off-by: Kevin Risden <krisden@apache.org>
2019-12-10 19:49:33 -05:00
Houston Putman 53345cb1cd SOLR-12217: Support shards.preference in SolrJ for individual shard requests (#984) 2019-12-09 23:13:33 -05:00
Robert Muir 0cd302d7b7 SOLR-14020: move hadoop hacks out of lucene TestSecurityManager into a solr one 2019-12-05 14:56:21 -05:00
Chris Hostetter b872863da9 SOLR-13864: SolrTestCaseJ4.getNextAvailablePort() has been deprecated
(cherry picked from commit 603be023fe)
2019-11-12 13:42:14 -07:00
Koen De Groote 575f8a6ad8 LUCENE-8994: Code Cleanup - Pass values to list constructor instead of empty constructor followed by addAll(). (#919) 2019-10-14 19:56:23 +02:00
Noble Paul f19aaa8097 SOLR-13821: Package Store for storing package artifacts (#929)
SOLR-13821: Package Store for storing package artifacts
2019-10-08 22:21:41 +11:00
Jason Gerlowski 20e382984a SOLR-13539: Introduce EmbeddedSolrServerTestBase
This groundwork commit allows tests to randomize request content-type
more flexibly.  This will be taken advantage of by subsequent commits.

Co-Authored-By: Thomas Woeckinger
Closes: #755
2019-10-08 06:31:11 -04:00
Ishan Chattopadhyaya af2fe8febc SOLR-13661: Reverting all half-baked stuff from SOLR-13707, SOLR-13659, SOLR-13565, SOLR-13650, SOLR-13710, SOLR-13721, SOLR-13637
All half baked package management and hot-classloading code reverted to allow for a fresh start.
2019-10-06 20:38:59 +05:30
Christine Poerschke e734b40375 SOLR-13812: Add javadocs, uneven rejection and basic test coverage for the SolrTestCaseJ4.params method.
(Diego Ceccarelli, Christine Poerschke, Munendra S N)
2019-10-04 11:35:04 +01:00
Chris Hostetter 3559e440e0 Minor logging improvements
(cherry picked from commit 0ec7986fc0)
2019-09-30 10:28:35 -07:00
Erick Erickson e6892683a2 :SOLR-13454: Investigate ReindexCollectionTest failures, added more safeguards in bandaid code
(cherry picked from commit 4f89987141)
2019-09-29 12:26:23 -04:00
Chris Hostetter e979255ca7 SOLR-13747: New TestSSLTestConfig.testFailIfUserRunsTestsWithJVMThatHasKnownSSLBugs() to give people running tests more visibility if/when they use a known-buggy JVM causing most SSL tests to silently SKIP
(cherry picked from commit ec9780c8aa)
2019-09-26 14:13:02 -07:00
Noble Paul 7d026f803d SOLR-13723: JettySolrRunner should support /api/* (the v2 end point) 2019-08-29 14:06:36 +10:00
noble 2835d2e323 formatting 2019-08-28 14:35:28 +10:00
Chris Hostetter b0b17c441e Additional logging in test framework methods that 'waitFor' something to better trace order of operations when failures occur
(cherry picked from commit 2fdc882bc4)
2019-08-21 13:14:01 -07:00
Noble Paul b0a11ba5c7 SOLR-13650: Support for named global classloaders 2019-08-20 11:56:18 +10:00
Chris Hostetter eb7e3b0114 SOLR-13701: Fixed JWTAuthPlugin to update metrics prior to continuing w/other filters or returning error
(cherry picked from commit f5856ef404)
2019-08-18 12:21:34 -07:00
Chris Hostetter 06dd37e907 SOLR-13464: Test work arounds
* Refactor existing work around in BasicAuthIntegrationTest up into SolrCloudAuthTestCase for re-use in JWTAuthPluginIntegrationTest

 * Simplify BasicAuthOnSingleNodeTest and PKIAuthenticationIntegrationTest to use their existing (static) security settings on creation of MiniSolrCloud.  Since they no longer modify security.json once the nodes are alive, the issue no longer affects them

(cherry picked from commit c7822c393e)
(cherry picked from commit 0291db44bc)
2019-08-12 14:57:18 -07:00
Munendra S N 488c75fb55 SOLR-12555: use expectThrows() to verify the ex thrown in tests 2019-08-03 13:19:53 +05:30
Chris Hostetter 89af2ec304 SOLR-13664: Fixed SolrTestCaseJ4.deleteCore() to properly reset the dataDir used by initCore()
(cherry picked from commit ab470a6564)
2019-08-01 09:16:02 -07:00
Chris Hostetter 3933047cd7 SOLR-13660: Fixed AbstractFullDistribZkTestBase.waitForActiveReplicaCount() to ensure replicas are active.
(cherry picked from commit 6dea203d11)
2019-07-30 10:15:07 -07:00
Munendra S N 37955f789e SOLR-12870: use StandardCharsets instead of String values
Fixes #469
2019-07-20 10:22:29 +05:30
Noble Paul e3b0fc7442 SOLR-13565, SOLR-13553 (#774)
* SOLR-13565: initial commit

* SOLR-13565: updated with testcase

* SOLR-13565: removed unused methods

* SOLR-13565: better logging

* SOLR-13565: disable SSL

* SOLR-13565: more tests

* SOLR-13565: syncing with master

* SOLR-13565: fixing tests

* SOLR-13565: fixing tests

* SOLR-13534: Fix test

Remove buggy 'port roulette' code that can easily fail if OS gives the selected port to a different process just before creating the server

Use jetty's built in support for listining on an OS selected port instead

Also increase timeouts to better account for slow/heavily loaded (ie:jenkins) VMs where SolrCore reloading may take longer then 10 seconds

* SOLR-13565: set proper permission name

* SOLR-13565: syncing with master

* SOLR-13565: syncing with master

* SOLR-13565: removed accidental change

* SOLR-13565: removed accidental change

* SOLR-13565: removed accidental change

* SOLR-13565: more tests

* SOLR-13565: Tests with key signing tests

* SOLR-13565: fixing concurrency issues in tests

* SOLR-13565: add tests with 512 bit RSA

* SOLR-13565: fixing concurrency issues

* SOLR-13565: remove unused code
2019-07-20 14:35:20 +10:00
Munendra S N fc15cd79f7 SOLR-12554: Expose IndexWriterConfig's ramPerThreadHardLimitMB
* When ramPerThreadHardLimitMB is not specified, then Lucene's
  default value 1945 is used. The specified value should be
  greater than 0 and less than 2048MB
2019-07-01 23:47:26 +05:30
Chris Hostetter 01b303c2e5 SOLR-12988: SSLTestConfig has been changed to throw AssumptionViolatedException when tests/seeds request SSL but the JVM appears to be an OpenJDK version known to have SSL bugs
SOLR-13574: Add CHANGES entry that was overlooked
(cherry picked from commit aaf20aefa4)
2019-06-27 15:52:22 -07:00
Chris Hostetter 8db2fdfa91 SOLR-13574: Fix many test and test-framework classes to not fail on After/AfterClass cleanup if assumptions fail in Before/BeforeClass setup
(cherry picked from commit 7e57d3a9d9)

Conflicts:
	solr/core/src/test/org/apache/solr/cloud/CleanupOldIndexTest.java
2019-06-27 10:39:24 -07:00
Chris Hostetter 456bc4dbf9 SOLR-12988: Fix Revert
an (erroneous) assigment to useSsl was left in the constructor after the (intended) conditional assigment, rendering the conditional logic useless

(cherry picked from commit c8c2f2f25b)
2019-06-20 16:05:11 -07:00
Cao Manh Dat 150e4f9863 SOLR-12988: Revert changes 2019-06-19 21:08:01 +01:00
Cao Manh Dat 64e3cc1789 SOLR-12988: Skip running tests with SSL on Java 11 to 11.0.2 2019-06-19 10:44:43 +01:00
Cao Manh Dat 968830a2be SOLR-12988: Avoid using TLSv1.3 for HttpClient 2019-06-18 13:17:51 +01:00
Chris Hostetter 2f2333a781 SOLR-13490: Fix CollectionStateWatcher/CollectionStatePredicate based APIs in ZkStateReader and CloudSolrClient to be triggered on liveNode changes.
Also add Predicate<DocCollection> equivilents for callers that don't care about liveNodes.

(cherry picked from commit 5a974860fa)
2019-06-17 10:00:05 -07:00
Cao Manh Dat 22fca67bfe SOLR-13541: Upgrade Jetty to 9.4.19.v20190610 2019-06-14 15:45:45 +01:00
erick cd809ef767 SOLR-12013: collections API CUSTERSTATUS command fails when configset missing 2019-06-11 13:29:23 -07:00
Koen De Groote 8b6a0d0964 LUCENE-8847: Code Cleanup: Rewrite StringBuilder.append with concatted strings (#707)
This specific commit affects all points in the casebase where the argument of a StringBuilder.append() call is itself a regular String concatenation.
This defeats the purpose of using StringBuilder and also introduces an extra alloction.
These changes should avoid that.

ant tests have run, succeeded on local machine.

Removing test files from the changes.

Another suggested rework.
2019-06-10 18:10:06 +02:00
Cao Manh Dat a39c342793 SOLR-13434: OpenTracing support for Solr (#685) 2019-06-04 20:05:17 +01:00
Erick Erickson e890980311 SOLR-8346: Upgrade Zookeeper to version 3.5.5
(cherry picked from commit 7ebeab71f4)
2019-06-03 17:59:01 -07:00
Erick Erickson 4c10edc3e4 SOLR-13454: Investigate ReindexCollectionTest failures. I missed a place where I should have called the bandaid code
(cherry picked from commit 0aaf543208)
2019-05-10 13:56:33 -07:00