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

Hoss Man reopened SOLR-10628:
-----------------------------

This hcange seems to have broken at least one (probably) 2 unrelated Solr tests 
because of how the SolrCLI class now assumes it should change the default log 
level to WARN -- and when CLI related tests run SolrCLI, nothing resets the log 
level.

Tests such as 
{{UpdateRequestProcessorFactoryTest.testUpdateDistribChainSkipping}} require 
INFO level logging in order to test that the logging related update processors 
work.

The following tests all execute an instance of SolrCLI, which means they all 
(now, with SOLR-10628 in place) muck with the stats of the (global) slf4j 
Logger in the JVM that runs these tests...

{noformat}
hossman@tray:~/lucene/dev/solr [master] $ find core/src/test -name \*.java | 
xargs grep -l SolrCLI 
core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java
core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
core/src/test/org/apache/solr/util/TestSolrCLIRunExample.java
core/src/test/org/apache/solr/util/UtilsToolTest.java
{noformat}

...so if {{UpdateRequestProcessorFactoryTest}} runs in the same JVM after one 
of those tests, it will fail.

just like changing system properties, or any other "static" variable in the 
JVM, tests that are going to explicitly (or implicitly) modify "static global" 
state of the JVM (in this case: the slf4j logging level) need to ensure that 
gets reset at the end of the test.

Example of current failure(s)...

{noformat}
   [junit4]   2> NOTE: reproduce with: ant test  
-Dtestcase=UpdateRequestProcessorFactoryTest
-Dtests.method=testUpdateDistribChainSkipping -Dtests.seed=CC8B32DFC6FE1FB8 
-Dtests.slow=true -Dtests.locale=tr
-Dtests.timezone=America/Winnipeg -Dtests.asserts=true 
-Dtests.file.encoding=UTF-8
   [junit4] FAILURE 0.01s J1 | 
UpdateRequestProcessorFactoryTest.testUpdateDistribChainSkipping <<<
   [junit4]    > Throwable #1: java.lang.AssertionError: Tests must be run with 
INFO level logging otherwise
LogUpdateProcessor isn't used and can't be tested.
   [junit4]    >        at 
__randomizedtesting.SeedInfo.seed([CC8B32DFC6FE1FB8:BD6FCC09B0153874]:0)
   [junit4]    >        at
org.apache.solr.update.processor.UpdateRequestProcessorFactoryTest.testUpdateDistribChainSkipping(UpdateRequestProce
ssorFactoryTest.java:101)
   [junit4]    >        at java.lang.Thread.run(Thread.java:748)
   [junit4]   2> NOTE: leaving temporary files on disk at:
/Users/jenkins/workspace/Lucene-Solr-7.x-MacOSX/solr/build/solr-core/test/J1/temp/solr.update.processor.UpdateReques
tProcessorFactoryTest_CC8B32DFC6FE1FB8-001
   [junit4]   2> NOTE: test params are: codec=CheapBastard, 
sim=RandomSimilarity(queryNorm=false): {}, locale=tr,
timezone=America/Winnipeg
   [junit4]   2> NOTE: Mac OS X 10.11.6 x86_64/Oracle Corporation 1.8.0_144
(64-bit)/cpus=3,threads=1,free=73087784,total=255750144
   [junit4]   2> NOTE: All tests run in this JVM: [TestCloudManagedSchema, 
TestRawTransformer,
OpenCloseCoreStressTest, SchemaVersionSpecificBehaviorTest, 
DistributedSuggestComponentTest, ZkStateWriterTest,
SegmentsInfoRequestHandlerTest, SolrCloudExampleTest, TestUninvertingReader, 
TestFastWriter, UpdateLogTest,
TestDynamicFieldResource, CoreSorterTest, TestStressUserVersions, 
DistributedQueueTest,
ChaosMonkeyNothingIsSafeWithPullReplicasTest, TestIndexSearcher, 
TestLMJelinekMercerSimilarityFactory,
TestNumericRangeQuery64, BlockJoinFacetDistribTest, TestDistributedMissingSort, 
TestChildDocTransformer,
TestDefaultStatsCache, TestLegacyNumericUtils, TestReloadDeadlock, 
HttpSolrCallGetCoreTest, TestMaxScoreQueryParser,
TestFiltering, TestConfigSetProperties, ConnectionReuseTest, 
TestClusterStateMutator, DistanceUnitsTest,
FieldMutatingUpdateProcessorTest, JsonLoaderTest, 
CloneFieldUpdateProcessorFactoryTest, AssignTest,
TestReRankQParserPlugin, BasicFunctionalityTest, HdfsBasicDistributedZkTest, 
OpenExchangeRatesOrgProviderTest,
InfixSuggestersTest, TestPullReplica, PropertiesRequestHandlerTest, 
SolrCloudReportersTest,
DistributedTermsComponentTest, CoreAdminRequestStatusTest, HttpPartitionTest, 
TestGraphMLResponseWriter,
TestManagedSchema, SystemInfoHandlerTest, TestInitQParser, 
TestSSLRandomization, TestPushWriter,
HdfsChaosMonkeySafeLeaderTest, TermVectorComponentTest, 
DistributedFacetExistsSmallTest, SolrGraphiteReporterTest,
TestRealTimeGet, UpdateRequestProcessorFactoryTest]
   [junit4] Completed [127/731 (1!)] on J1 in 0.55s, 3 tests, 1 failure <<< 
FAILURES!
{noformat}

I suspect this is also related based on the timing of when the failures started 
and the test name, but i'm not as familiar with this code so i'm not 100% 
certain...

{noformat}
   [junit4]   2> NOTE: reproduce with: ant test  
-Dtestcase=SolrSlf4jReporterTest -Dtests.method=testReporter
-Dtests.seed=63159D0C0E6136F5 -Dtests.multiplier=3 -Dtests.slow=true 
-Dtests.locale=de-GR
-Dtests.timezone=America/Swift_Current -Dtests.asserts=true 
-Dtests.file.encoding=ISO-8859-1
   [junit4] FAILURE 6.44s J1 | SolrSlf4jReporterTest.testReporter <<<
   [junit4]    > Throwable #1: java.lang.AssertionError: No 'solr.node' logs 
in: {numFound=0,start=0,docs=[]}
   [junit4]    >        at 
__randomizedtesting.SeedInfo.seed([63159D0C0E6136F5:3CF1B03B656DA5B0]:0)
   [junit4]    >        at
org.apache.solr.metrics.reporters.SolrSlf4jReporterTest.testReporter(SolrSlf4jReporterTest.java:85)
   [junit4]    >        at java.lang.Thread.run(Thread.java:748)
   [junit4]   2> 1294557 INFO  
(SUITE-SolrSlf4jReporterTest-seed#[63159D0C0E6136F5]-worker) [    ]
o.a.s.SolrTestCaseJ4 ###deleteCore
   [junit4]   2> NOTE: leaving temporary files on disk at:
/home/jenkins/workspace/Lucene-Solr-master-Linux/solr/build/solr-core/test/J1/temp/solr.metrics.reporters.SolrSlf4jR
eporterTest_63159D0C0E6136F5-001
   [junit4]   2> NOTE: test params are: codec=SimpleText, 
sim=RandomSimilarity(queryNorm=false): {}, locale=de-GR,
timezone=America/Swift_Current
   [junit4]   2> NOTE: Linux 4.10.0-27-generic i386/Oracle Corporation 1.8.0_144
(32-bit)/cpus=8,threads=1,free=235294520,total=358612992
   [junit4]   2> NOTE: All tests run in this JVM: 
[StatelessScriptUpdateProcessorFactoryTest, TestQueryTypes,
DeleteInactiveReplicaTest, DataDrivenBlockJoinTest, OverseerTaskQueueTest, 
AlternateDirectoryTest, TestRestManager,
CollectionsAPISolrJTest, HighlighterTest, TestSchemaNameResource, 
StatsReloadRaceTest, TestLegacyFieldReuse,
OverseerModifyCollectionTest, SubstringBytesRefFilterTest, EnumFieldTest, 
TestSchemaVersionResource,
MoveReplicaTest, CollectionsAPIDistributedZkTest, TestCoreContainer, 
ScriptEngineTest, TestMiniSolrCloudClusterSSL,
SolrMetricReporterTest, TestTrackingShardHandlerFactory, 
TestCloudDeleteByQuery, TestGraphMLResponseWriter,
TestPostingsSolrHighlighter, MetricUtilsTest, TestXIncludeConfig, 
SpatialFilterTest, TestTlogReplica,
HdfsChaosMonkeySafeLeaderTest, TestSolrCLIRunExample, 
TestPayloadScoreQParserPlugin, TestCloudManagedSchema,
ClusterStateUpdateTest, TestReloadDeadlock, ShardRoutingCustomTest, 
RemoteQueryErrorTest,
DistributedIntervalFacetingTest, ClassificationUpdateProcessorTest, 
LoggingHandlerTest, TestFieldResource,
LargeFieldTest, TestReplicationHandlerBackup, AnalysisAfterCoreReloadTest, 
TestDocBasedVersionConstraints,
AssignBackwardCompatibilityTest, BlobRepositoryCloudTest, 
TestSolrFieldCacheBean, WrapperMergePolicyFactoryTest,
TestSweetSpotSimilarityFactory, TestRTGBase, TestChildDocTransformer, 
SoftAutoCommitTest, CoreAdminHandlerTest,
CollectionStateFormat2Test, TestLeaderInitiatedRecoveryThread, 
TestDFISimilarityFactory, TestBM25SimilarityFactory,
DistribCursorPagingTest, TestSystemIdResolver, TestAtomicUpdateErrorCases, 
SharedFSAutoReplicaFailoverUtilsTest,
BasicFunctionalityTest, TestSolrConfigHandler, TestMaxTokenLenTokenizer, 
JSONWriterTest,
TestSolrCloudWithHadoopAuthPlugin, TestClusterStateMutator, 
DistributedSuggestComponentTest,
TermVectorComponentTest, TestSearchPerf, TestSolrCloudWithDelegationTokens, 
TestSha256AuthenticationProvider,
TestRandomRequestDistribution, ResponseHeaderTest, TestCoreDiscovery, 
TestSolrConfigHandlerConcurrent,
TestMaxScoreQueryParser, ForceLeaderTest, MoreLikeThisHandlerTest, 
CdcrReplicationHandlerTest,
TestReloadAndDeleteDocs, TestAuthorizationFramework, TestInfoStreamLogging, 
CleanupOldIndexTest,
DistanceFunctionTest, TestExactSharedStatsCache, TestNumericTokenStream, 
TestSolrJ, BitVectorTest,
TestCloudSearcherWarming, ConvertedLegacyTest, 
SchemaVersionSpecificBehaviorTest, ZkCLITest, BadCopyFieldTest,
HLLSerializationTest, TestSolrCoreSnapshots, TestSolrIndexConfig, 
ZkFailoverTest, ConnectionReuseTest,
TestRawResponseWriter, SolrCloudExampleTest, HdfsSyncSliceTest, TestTrieFacet, 
BlockJoinFacetDistribTest,
AtomicUpdatesTest, TestFuzzyAnalyzedSuggestions, TestSmileRequest, 
SliceStateTest, OpenCloseCoreStressTest,
TestCollectionsAPIViaSolrCloudCluster, TestFieldCacheReopen, 
SolrSlf4jReporterTest]
   [junit4] Completed [353/732 (1!)] on J1 in 6.48s, 1 test, 1 failure <<< 
FAILURES!

{noformat}


> Less verbose output from bin/solr commands
> ------------------------------------------
>
>                 Key: SOLR-10628
>                 URL: https://issues.apache.org/jira/browse/SOLR-10628
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: scripts and tools
>            Reporter: Jan Høydahl
>            Assignee: Jan Høydahl
>             Fix For: master (8.0), 7.1
>
>         Attachments: SOLR-10628.patch, SOLR-10628.patch, SOLR-10628.patch, 
> SOLR-10628.patch, SOLR-10628.patch, solr_script_outputs.txt, 
> updated_command_output.txt
>
>
> Creating a collection with {{bin/solr create}} today is too verbose:
> {noformat}
> $ bin/solr create -c foo
> Connecting to ZooKeeper at localhost:9983 ...
> INFO  - 2017-05-08 09:06:54.409; 
> org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider; Cluster at 
> localhost:9983 ready
> Uploading 
> /Users/janhoy/git/lucene-solr/solr/server/solr/configsets/data_driven_schema_configs/conf
>  for config foo to ZooKeeper at localhost:9983
> Creating new collection 'foo' using command:
> http://localhost:8983/solr/admin/collections?action=CREATE&name=foo&numShards=1&replicationFactor=1&maxShardsPerNode=1&collection.configName=foo
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":4178},
>   "success":{"192.168.127.248:8983_solr":{
>       "responseHeader":{
>         "status":0,
>         "QTime":2959},
>       "core":"foo_shard1_replica1"}}}
> {noformat}
> A normal user don't need all this info. Propose to move all the details to 
> verbose mode ({{-V)}} and let the default be the following instead:
> {noformat}
> $ bin/solr create -c foo
> Connecting to ZooKeeper at localhost:9983 ...
> Created collection 'foo' with 1 shard(s), 1 replica(s) using config-set 
> 'data_driven_schema_configs'
> {noformat}
> Error messages must of course still be verbose.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to