messageExchange.getTimestamp() maven overwriting value - maven

when using messageExchange.getTimestamp() directely friom soapui .
im getting the right values back. so the response time is around 50ms.
However, if i use maven to trigger the same project. then the time which is log for getTimestamp becomes 500ms.
so question is, is the "messageExchange.getTimestamp()" calcuiting the actual response time or the run time to trigger the request and get response ?
also, if the project contains more than one file. so 3 requests to be sent.
the first one takes 500ms
second one takes 50ms
and third takes 45ms
so the times for the second the third request are right. not the first.
how to fix this ?
logs below showing the time difference. keeping in mind its the same request. if this is run directly from soapui, issues isnt there. issue only comes up when we run this throguh maven.
T E S T S
-------------------------------------------------------
Running com.test.app.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- soapui-maven-plugin:5.2.1:test (soapUI4) # projectNAme ---
SoapUI 5.2.1 Maven2 TestCase Runner
2017-02-27 10:44:57,239 [BuilderThread 0] INFO com.eviware.soapui.tools.SoapUITestCaseRunner - Setting global property [enviroment] to [Enviroment]
2017-02-27 10:44:57,239 [BuilderThread 0] INFO com.eviware.soapui.tools.SoapUITestCaseRunner - Setting global property [projectname] to [projectNAme]
10:44:57,939 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\test\soapui-settings.xml]
10:45:02,071 INFO [PluginManager] 0 plugins loaded in 2 ms
10:45:02,071 INFO [DefaultSoapUICore] All plugins loaded
10:45:03,427 INFO [WsdlProject] Loaded project from [file:/C:/automation/soapui-project.xml]
10:45:03,437 INFO [SoapUITestCaseRunner] Running SoapUI tests in project [#resposnetimeAutomation]
10:45:03,439 INFO [SoapUITestCaseRunner] Running Project [#resposnetimeAutomation], runType = SEQUENTIAL
10:45:05,637 INFO [log] =============START=============
10:45:05,669 INFO [SoapUITestCaseRunner] Running SoapUI testcase [Projecttest]
10:45:05,677 INFO [SoapUITestCaseRunner] running step [setProperties]
10:45:05,743 INFO [SoapUITestCaseRunner] running step [GetRequests]
10:45:05,829 INFO [SoapUITestCaseRunner] running step [assignPropertyValues]
10:45:06,078 INFO [log] Assign prop about to send file name: tc_01_tst.xml
10:45:06,202 INFO [SoapUITestCaseRunner] running step [TriggerRequest]
10:45:06,818 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
10:45:06,818 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /endpoint/test HTTP/1.0
10:45:06,851 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
10:45:06,868 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection shut down
10:45:06,912 INFO [SoapUITestCaseRunner] running step [verificationStep]
10:45:08,222 INFO [log] response Time in ms: ==================== 445
10:45:08,222 INFO [log] responsegetTimestamp Time in ms: ==================== 1488152706869
10:45:08,222 INFO [log] ==================================================================================
10:45:08,222 INFO [log] HTTP status code: 200
10:45:08,223 INFO [log] ==================================================================================
10:45:09,262 INFO [SoapUITestCaseRunner] running step [triggerrequest]
10:45:09,285 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
10:45:09,285 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /endpoint/test HTTP/1.0
10:45:09,312 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
10:45:09,312 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection shut down
10:45:09,322 INFO [SoapUITestCaseRunner] running step [verificationStep]
10:45:09,323 INFO [log] response Time in ms: ==================== 31
10:45:09,324 INFO [log] responsegetTimestamp Time in ms: ==================== 1488152709313
10:45:09,324 INFO [log] ==================================================================================
10:45:09,324 INFO [log] HTTP status code: 200
10:45:09,324 INFO [log] ==================================================================================
10:45:09,933 INFO [SoapUITestCaseRunner] running step [assignPropertyValues]
10:45:09,933 INFO [log] Assign prop about to send file name: tc2dass.xml
10:45:09,978 INFO [SoapUITestCaseRunner] running step [triggerrequest]
10:45:09,987 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
10:45:09,987 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /endpoint/test HTTP/1.0
10:45:10,008 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
10:45:10,009 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection shut down
10:45:10,017 INFO [SoapUITestCaseRunner] running step [verificationStep]
10:45:10,019 INFO [log] response Time in ms: ==================== 25
10:45:10,020 INFO [log] responsegetTimestamp Time in ms: ==================== 1488152710009
10:45:10,020 INFO [log] ==================================================================================
10:45:10,020 INFO [log] HTTP status code: 200
10:45:10,020 INFO [log] ==================================================================================
10:45:10,713 INFO [SoapUITestCaseRunner] Finished running SoapUI testcase [Projecttest], time taken: 4908ms, status: FAILED
10:45:10,723 INFO [SoapUITestCaseRunner] Project [#resposnetimeAutomation] finished with status [FAILED] in 7278ms

Related

Gitlab job is successful despite assertion failure

I am running SoapUI assertions using maven image in gitlab. Even though the assertion fails the build is successful in gitlab. I have tried using mvn integration-tests -ff and as well as -fae but no luck. Also used allow_failure: false. This did not work either. Please advise as to how to fail the gitlab pipeline job if there is a failure in assertions.
Here is my yml file
T001-0011:
extends: .ETE -stage
image: adoptopenjdk/maven-openjdk11
variables:
MAVEN_CLI_OPTS: "--fail-fast"
script:
- 'mvn -f ./TV001/pom.xml $MAVEN_CLI_OPTS integration-test'
allow_failure: false
when: always
Here is the gitlab log
1 error
09:53:48,937 ERROR [SoapUITestCaseRunner] JDBC_Request failed, exporting to [/builds/gitlab/data/test-team-automation-scripts/./SV321/Warnings/target/surefire-reports/TestSuite_1-AC1-JDBC_Request-0-FAILED.txt]
09:53:48,938 INFO [SoapUITestCaseRunner] Finished running SoapUI testcase [AC1], time taken: 904ms, status: FAILED
09:53:48,953 INFO [SoapUITestCaseRunner] Running SoapUI testcase [AC2]
09:53:48,963 INFO [SoapUITestCaseRunner] running step [IDN220001-Request2]
09:53:48,966 DEBUG [HttpClientSupport$SoapUIHttpClient] Stale connection check
09:53:48,968 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
09:53:48,968 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: GET /apikey/v1/warnings/waning/IDN22000 HTTP/1.1
09:53:48,974 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 404 Not Found
09:53:48,975 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive indefinitely
09:53:49,018 INFO [log] HTTP status code: 404
09:53:49,019 INFO [SoapUITestCaseRunner] Assertion [Valid HTTP Status Codes] has status UNKNOWN
09:53:49,019 INFO [SoapUITestCaseRunner] Assertion [Script Assertion] has status VALID
09:53:49,019 INFO [SoapUITestCaseRunner] Finished running SoapUI testcase [AC2], time taken: 8ms, status: FINISHED
09:53:49,021 INFO [SoapUITestCaseRunner] Project [DPD-3396] finished with status [FAILED] in 2591ms
SoapUI 5.3.0 TestCaseRunner Summary
-----------------------------
Time Taken: 2599ms
Total TestSuites: 1
Total TestCases: 2 (1 failed)
Total TestSteps: 3
Total Request Assertions: 5
Total Failed Assertions: 1
Total Exported Results: 3
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:03 min
[INFO] Finished at: 2022-06-15T09:53:54+10:00
[INFO] ------------------------------------------------------------------------
Cleaning up file based variables
00:01
Job succeeded
The mvn tests fail but the exit code that the command itself returns, probably is zero.
It is saying, I managed to run the tests.
But for you this doesn't help since you want to check the result of the tests.
Gitlab in order to fail a job checks the exit code of the commands used. You could force mvn to return an erroneous exit code when the tests fail
You could add the following flag
-Dmaven.test.failure.ignore=false

Error sending data to APM even after successful connectivity

Able to establish APM connection
2021-03-09 17:45:05,741 [Attach Listener] INFO co.elastic.apm.agent.configuration.StartupInfo - VM Arguments: [-XX:TieredStopAtLevel=1, -Xmx6g, -Dfile.encoding=UTF-8, -Duser.country=IN, -Duser.language=en, -Duser.variant]
2021-03-09 17:45:08,192 [Attach Listener] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to RUNNING state
2021-03-09 17:45:08,734 [elastic-apm-server-healthcheck] INFO co.elastic.apm.agent.report.ApmServerHealthChecker - Elastic APM server is available: { "build_date": "2021-02-15T12:37:48Z", "build_sha": "e77061bb3aaedae5ae8dd0ca193eb662513aedde", "version": "7.11.0"}
But post connection, it still throws this error. What could be wrong here, appreciate any inputs on this
2021-03-09 17:45:53,484 [elastic-apm-server-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 0 seconds (+/-10%)
2021-03-09 17:45:53,489 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Error sending data to APM server: Read timed out, response code is -1
2021-03-09 17:45:53,489 [elastic-apm-server-reporter] WARN co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - null
2021-03-09 17:46:08,890 [elastic-apm-server-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 1 seconds (+/-10%)
2021-03-09 17:46:09,922 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Error sending data to APM server: Read timed out, response code is -1
2021-03-09 17:46:09,922 [elastic-apm-server-reporter] WARN co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - null
Check your kibana.yml file URLs, when I setup APM I my machine some of my URLs (elasticsearch.hosts, xpack.fleet.outputs) were defaulted to my current IP address (instead of localhost), which changed after a reboot.

Spark streaming job on YARN cluster mode stuck in accepted, then fails with a Timeout Exception

I am running a spark streaming application that simply read messages from a Kafka topic, enrich them and then write the enriched messages in another kafka topic.
I already tried it in Standalone mode (both client and cluster deploy mode) and in YARN client mode, successfully.
When I submit the application in cluster mode it gives me the following messages:
18/01/10 12:13:34 INFO Client: Submitting application application_1515582681419_0001 to ResourceManager
18/01/10 12:13:34 INFO YarnClientImpl: Submitted application application_1515582681419_0001
18/01/10 12:13:35 INFO Client: Application report for application_1515582681419_0001 (state: ACCEPTED)
18/01/10 12:13:35 INFO Client:
client token: N/A
diagnostics: AM container is launched, waiting for AM container to Register with RM
ApplicationMaster host: N/A
ApplicationMaster RPC port: -1
queue: default
start time: 1515582814080
final status: UNDEFINED
tracking URL: http://ambari1.internal:8088/proxy/application_1515582681419_0001/
user: root
18/01/10 12:13:36 INFO Client: Application report for application_1515582681419_0001 (state: ACCEPTED)
18/01/10 12:13:37 INFO Client: Application report for application_1515582681419_0001 (state: ACCEPTED)
And keeps stuck in ACCEPTED Status until after around 4-5 minutes, exit with the following error message:
18/01/10 12:17:00 INFO InputInfoTracker: remove old batch metadata: 1515583000000 ms
18/01/10 12:17:02 ERROR ApplicationMaster: Uncaught exception:
java.util.concurrent.TimeoutException: Futures timed out after [100000 milliseconds]
at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219)
at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223)
at org.apache.spark.util.ThreadUtils$.awaitResult(ThreadUtils.scala:201)
at org.apache.spark.deploy.yarn.ApplicationMaster.runDriver(ApplicationMaster.scala:423)
at org.apache.spark.deploy.yarn.ApplicationMaster.run(ApplicationMaster.scala:282)
at org.apache.spark.deploy.yarn.ApplicationMaster$$anonfun$main$1.apply$mcV$sp(ApplicationMaster.scala:768)
at org.apache.spark.deploy.SparkHadoopUtil$$anon$2.run(SparkHadoopUtil.scala:67)
at org.apache.spark.deploy.SparkHadoopUtil$$anon$2.run(SparkHadoopUtil.scala:66)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1866)
at org.apache.spark.deploy.SparkHadoopUtil.runAsSparkUser(SparkHadoopUtil.scala:66)
at org.apache.spark.deploy.yarn.ApplicationMaster$.main(ApplicationMaster.scala:766)
at org.apache.spark.deploy.yarn.ApplicationMaster.main(ApplicationMaster.scala)
18/01/10 12:17:02 INFO ApplicationMaster: Final app status: FAILED, exitCode: 10, (reason: Uncaught exception: java.util.concurrent.TimeoutException: Futures timed out after [100000 milliseconds])
18/01/10 12:17:02 INFO StreamingContext: Invoking stop(stopGracefully=false) from shutdown hook
18/01/10 12:17:02 INFO ReceiverTracker: ReceiverTracker stopped
18/01/10 12:17:02 INFO JobGenerator: Stopping JobGenerator immediately
Funny fact: If I visit the age of the application, I can see that the Spark Context has been started and it processes some messages.
Could anyone help me on this?
PS: These are the resources of my YARN cluster:
The problem might be with Yarn "App Timeline Server". Try to restart it.
Are you creating your spark session with master as local?. Please do check this.

SOAPUI maven report not showing full log in the HTML report

I was able to generate a html report using maven with the "maven-surefire-report-plugin" but the HTML report is plain simple and does not have logs for each test.
This is what it looks like:
Is it possible to have all the test steps under these test cases? The messages appears in the output log file, so something like this:
2016-09-30 22:43:50,822 INFO [SoapUITestCaseRunner] Assertion [SOAP Response] has status VALID
2016-09-30 22:43:50,822 INFO [SoapUITestCaseRunner] Assertion [Assert Success Message] has status VALID
2016-09-30 22:43:50,822 INFO [SoapUITestCaseRunner] Assertion [Valid HTTP Status Code 200] has status VALID
2016-09-30 22:43:50,822 INFO [SoapUITestCaseRunner] Finished running SoapUI

SpringXD -> twitterstream --follow: ending with Http error

I'm trying to crate a stream that should follow #BBCBreaking (what should have 5402612 twitter ID), but I keep getting following Http error:
2016-03-28T02:13:12+0200 1.3.1.RELEASE INFO DeploymentSupervisor-0 zk.ZKStreamDeploymentHandler - Deployment status for stream 'mystream': DeploymentStatus{state=deployed}
2016-03-28T02:13:13+0200 1.3.1.RELEASE WARN twitterSource-1-1 twitter.TwitterStreamChannelAdapter - Http error, waiting for 5 seconds before restarting
2016-03-28T02:13:19+0200 1.3.1.RELEASE WARN twitterSource-1-1 twitter.TwitterStreamChannelAdapter - Http error, waiting for 10 seconds before restarting
2016-03-28T02:13:30+0200 1.3.1.RELEASE WARN twitterSource-1-1 twitter.TwitterStreamChannelAdapter - Http error, waiting for 20 seconds before restarting
my stream command is:
stream create --name mystream --definition "twitterstream --follow='5402612' | log" --deploy
running on SpringXD: 1.3.1.RELEASE
please, any idea that why the error?
You can debug such situations by enabling DEBUG logging - log config is in the xd/config folder in .groovy files; e.g. xd-singlenode-logback.groovy.
Set the loggers for org.springframework.integration and org.springframework.xd, org.springframework.xd.dirt.server to DEBUG and add a logger for org.springframework.social.twitter also at DEBUG.
Or you can set all of org.springframework and comment out the more specific ones.

Resources