You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by GitBox <gi...@apache.org> on 2022/06/23 13:47:00 UTC

[GitHub] [jmeter] vlsi opened a new pull request, #717: [66139] Ensure Open Model Thread Group initializes config elements only once

vlsi opened a new pull request, #717:
URL: https://github.com/apache/jmeter/pull/717

   See https://bz.apache.org/bugzilla/show_bug.cgi?id=66139
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jmeter] vlsi merged pull request #717: [66139] Ensure Open Model Thread Group initializes config elements only once

Posted by "vlsi (via GitHub)" <gi...@apache.org>.
vlsi merged PR #717:
URL: https://github.com/apache/jmeter/pull/717


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jmeter] codecov-commenter commented on pull request #717: [66139] Ensure Open Model Thread Group initializes config elements only once

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #717:
URL: https://github.com/apache/jmeter/pull/717#issuecomment-1171225061

   # [Codecov](https://codecov.io/gh/apache/jmeter/pull/717?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#717](https://codecov.io/gh/apache/jmeter/pull/717?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0a82bc2) into [master](https://codecov.io/gh/apache/jmeter/commit/7548000b1f1dc6708e2186afa721df71057b8082?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7548000) will **increase** coverage by `0.08%`.
   > The diff coverage is `34.61%`.
   
   > :exclamation: Current head 0a82bc2 differs from pull request most recent head 5de2d3f. Consider uploading reports for the commit 5de2d3f to get more accurate results
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/jmeter/pull/717/graphs/tree.svg?width=650&height=150&src=pr&token=6Q7CI1wFSh&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/jmeter/pull/717?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #717      +/-   ##
   ============================================
   + Coverage     55.23%   55.32%   +0.08%     
   - Complexity    10381    10393      +12     
   ============================================
     Files          1062     1062              
     Lines         65760    65763       +3     
     Branches       7533     7534       +1     
   ============================================
   + Hits          36322    36381      +59     
   + Misses        26837    26777      -60     
   - Partials       2601     2605       +4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/jmeter/pull/717?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...e/jmeter/threads/openmodel/OpenModelThreadGroup.kt](https://codecov.io/gh/apache/jmeter/pull/717/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL2NvcmUvc3JjL21haW4va290bGluL29yZy9hcGFjaGUvam1ldGVyL3RocmVhZHMvb3Blbm1vZGVsL09wZW5Nb2RlbFRocmVhZEdyb3VwLmt0) | `68.53% <0.00%> (+57.17%)` | :arrow_up: |
   | [.../apache/jmeter/threads/openmodel/scheduleParser.kt](https://codecov.io/gh/apache/jmeter/pull/717/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL2NvcmUvc3JjL21haW4va290bGluL29yZy9hcGFjaGUvam1ldGVyL3RocmVhZHMvb3Blbm1vZGVsL3NjaGVkdWxlUGFyc2VyLmt0) | `68.93% <0.00%> (-0.68%)` | :arrow_down: |
   | [...ache/jmeter/threads/openmodel/scheduleTokenizer.kt](https://codecov.io/gh/apache/jmeter/pull/717/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL2NvcmUvc3JjL21haW4va290bGluL29yZy9hcGFjaGUvam1ldGVyL3RocmVhZHMvb3Blbm1vZGVsL3NjaGVkdWxlVG9rZW5pemVyLmt0) | `79.06% <0.00%> (-1.89%)` | :arrow_down: |
   | [...org/apache/jmeter/engine/StandardJMeterEngine.java](https://codecov.io/gh/apache/jmeter/pull/717/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL2NvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci9lbmdpbmUvU3RhbmRhcmRKTWV0ZXJFbmdpbmUuamF2YQ==) | `60.40% <36.36%> (+0.67%)` | :arrow_up: |
   | [...org/apache/jmeter/threads/AbstractThreadGroup.java](https://codecov.io/gh/apache/jmeter/pull/717/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL2NvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci90aHJlYWRzL0Fic3RyYWN0VGhyZWFkR3JvdXAuamF2YQ==) | `90.14% <50.00%> (ø)` | |
   | [...hreads/openmodel/OpenModelThreadGroupController.kt](https://codecov.io/gh/apache/jmeter/pull/717/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL2NvcmUvc3JjL21haW4va290bGluL29yZy9hcGFjaGUvam1ldGVyL3RocmVhZHMvb3Blbm1vZGVsL09wZW5Nb2RlbFRocmVhZEdyb3VwQ29udHJvbGxlci5rdA==) | `100.00% <100.00%> (+75.00%)` | :arrow_up: |
   | [...jmeter/protocol/http/control/HttpMirrorServer.java](https://codecov.io/gh/apache/jmeter/pull/717/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL3Byb3RvY29sL2h0dHAvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci9wcm90b2NvbC9odHRwL2NvbnRyb2wvSHR0cE1pcnJvclNlcnZlci5qYXZh) | `41.41% <0.00%> (-1.02%)` | :arrow_down: |
   | [...rg/apache/jmeter/threads/JMeterContextService.java](https://codecov.io/gh/apache/jmeter/pull/717/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL2NvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci90aHJlYWRzL0pNZXRlckNvbnRleHRTZXJ2aWNlLmphdmE=) | `97.82% <0.00%> (+2.17%)` | :arrow_up: |
   | [...hreads/openmodel/ThreadScheduleProcessGenerator.kt](https://codecov.io/gh/apache/jmeter/pull/717/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL2NvcmUvc3JjL21haW4va290bGluL29yZy9hcGFjaGUvam1ldGVyL3RocmVhZHMvb3Blbm1vZGVsL1RocmVhZFNjaGVkdWxlUHJvY2Vzc0dlbmVyYXRvci5rdA==) | `88.88% <0.00%> (+2.77%)` | :arrow_up: |
   | [...ache/jmeter/testelement/property/NullProperty.java](https://codecov.io/gh/apache/jmeter/pull/717/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL2NvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2ptZXRlci90ZXN0ZWxlbWVudC9wcm9wZXJ0eS9OdWxsUHJvcGVydHkuamF2YQ==) | `65.00% <0.00%> (+10.00%)` | :arrow_up: |
   | ... and [1 more](https://codecov.io/gh/apache/jmeter/pull/717/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/jmeter/pull/717?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/jmeter/pull/717?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [7548000...5de2d3f](https://codecov.io/gh/apache/jmeter/pull/717?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jmeter] vlsi commented on pull request #717: [66139] Ensure Open Model Thread Group initializes config elements only once

Posted by GitBox <gi...@apache.org>.
vlsi commented on PR #717:
URL: https://github.com/apache/jmeter/pull/717#issuecomment-1177762798

   The test keeps failing at Travis.
   I'm inclined to disable the test and commit the code.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jmeter] FSchumacher commented on a diff in pull request #717: [66139] Ensure Open Model Thread Group initializes config elements only once

Posted by GitBox <gi...@apache.org>.
FSchumacher commented on code in PR #717:
URL: https://github.com/apache/jmeter/pull/717#discussion_r913805737


##########
src/core/src/main/java/org/apache/jmeter/engine/StandardJMeterEngine.java:
##########
@@ -84,6 +91,14 @@ public class StandardJMeterEngine implements JMeterEngine, Runnable {
     /** Whether to call System.exit(0) unconditionally at end of non-GUI test */
     private static final boolean SYSTEM_EXIT_FORCED = JMeterUtils.getPropDefault("jmeterengine.force.system.exit", false);
 
+    /**
+     * Executor service to execute management tasks like "start test", "stop test".
+     * The use of {@link ExecutorService} allows propagating the exception from the threads.
+     */
+    private static final ExecutorService EXECUTOR_SERVICE = Executors.newCachedThreadPool();

Review Comment:
   Have you considered using an [Thread.UncaughtExceptionHandler](https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.UncaughtExceptionHandler.html) instead?



##########
src/components/src/test/kotlin/org/apache/jmeter/threads/openmodel/OpenModelThreadGroupConfigElementTest.kt:
##########
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jmeter.threads.openmodel
+
+import org.apache.jmeter.control.TestTransactionController
+import org.apache.jmeter.engine.StandardJMeterEngine
+import org.apache.jmeter.junit.JMeterTestCase
+import org.apache.jmeter.modifiers.CounterConfig
+import org.apache.jmeter.sampler.DebugSampler
+import org.apache.jmeter.testelement.TestPlan
+import org.apache.jmeter.testelement.property.TestElementProperty
+import org.apache.jmeter.threads.AbstractThreadGroup
+import org.apache.jorphan.collections.ListedHashTree
+import org.apache.jorphan.test.JMeterSerialTest
+import org.junit.Assert
+import org.junit.Test
+import java.time.Duration
+
+class OpenModelThreadGroupConfigElementTest : JMeterTestCase(), JMeterSerialTest {

Review Comment:
   Really nice test class.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [jmeter] vlsi commented on a diff in pull request #717: [66139] Ensure Open Model Thread Group initializes config elements only once

Posted by GitBox <gi...@apache.org>.
vlsi commented on code in PR #717:
URL: https://github.com/apache/jmeter/pull/717#discussion_r913832043


##########
src/core/src/main/java/org/apache/jmeter/engine/StandardJMeterEngine.java:
##########
@@ -84,6 +91,14 @@ public class StandardJMeterEngine implements JMeterEngine, Runnable {
     /** Whether to call System.exit(0) unconditionally at end of non-GUI test */
     private static final boolean SYSTEM_EXIT_FORCED = JMeterUtils.getPropDefault("jmeterengine.force.system.exit", false);
 
+    /**
+     * Executor service to execute management tasks like "start test", "stop test".
+     * The use of {@link ExecutorService} allows propagating the exception from the threads.
+     */
+    private static final ExecutorService EXECUTOR_SERVICE = Executors.newCachedThreadPool();

Review Comment:
   I do not think UncaughtExceptionHandler makes things any easier/better. I think `EXECUTOR_SERVICE.submit(...)` gives exception tracking for free, and we should move away from `new Thread` anyway.
   
   ---
   
   The main problem here is that `StandardJMeterEngine.runTest` returns `void`, and there's no way for the client to detect if the test failed or not.
   
   In the ideal case, `StandardJMeterEngine.runTest` should return something like `Future<...>`, so the client could await termination or cancel it, or get the results.
   
   However, the change of `runTest` to return `Future` is out of the scope of this PR. In this PR, I added the ability to execute and wait for results from `StandardJMeterEngine` from unit-test code. So I did the minimal set of changes only.
   
   
    



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org