How can you timeout a request from newman CLI - postman-collection-runner

I have a test suite in Postman and for a request it waits for a specific status in the response body.
I have created a loop through to trigger the request each time until that status field is updated with the expected flag.
The problem is that there is a risk I might go into an infinite loop in case the process gets stuck and when the test runs in the pipelines it will retrigger the same request until someone cancels the pipeline or the pipeline task eventually timesout.
I want to be able to fail a test or collection if it takes x amount of time to run but the --timeout set in the CLI it's not taken into account when running through AzureDevops Pipelines.
Any solutions? Thank you!

Have you tried --timeout-script?
You can find all the Newman command options here - Newman Command Options.
Newman Request Options

Related

Re-run Cypress test in Github Actions does not work

I have a cypress workflow in Github and it runs nicely. But, when the e2e tests fail for some reason and I want to re-run them using the re-run all jobs button (below), the following message appears:
The run you are attempting to access is already complete and will not accept new groups.
The existing run is: https://dashboard.cypress.io/projects/abcdef/runs
When a run finishes all of its groups, it waits for a configurable set of time before finally completing. You must add more groups during that time period.
The --tag flag you passed was:
The --group flag you passed was: core
What should I change in my configuration to make these possible? Sometimes the e2e fails because of a backend error that is fixed later.
I'd like to do this instead of a force e2e commit.
I was facing the same issue before.
I think you can try to pass GITHUB_TOKEN or add a custom build id. It fixed my issue. Hoep it helps.
https://github.com/cypress-io/github-action#custom-build-id
Check your Cypress Dashboard subscription plan. Mine got the free plan full (500 test for free and I was running in 3 different browsers 57 tests, so it got full pretty quick since this is 171 tests in one run) and after that it didn't allowed me to keep running or re running more parallel tests. Test kept running but in 1 machine out of 4 in the first browser and stages for the other 2 browsers started failing, I was able to allow the pipeline to not be failing by passing continueOnError: true in the configuration.
Quick edit, I don't remember where but I read that you could also add a delay to your pipeline and/or reduce the default wait on the Dashboard which is 60s(https://docs.cypress.io/guides/guides/parallelization#Run-completion-delay)

Jmeter- Reading Application log

I am running a jmeter test, POST submitting a request i need to check the application log(openshift) to find an application specific message/id is generated ,it need to be captured as its a test data for my subsequent request. Any solution is much appreciated.
Depending on your setup you can go for:
Normal HTTP Request call to /api/v1/namespaces/$NAMESPACE/pods/$NAME/log
Run oc log command using OS Process Sampler or SSH Command sampler

Restart Script from Beginning if Failures encountered in Jmeter

I have around 20 transactions in my jmeter script, I need to run a load test for 2000 Users.
I have added test checks and Assertions to validate if the transactions are passing
I want to introduce error handling , where the script start from the beginning if any of the assertions/transactions fail
I am not sure if I have understood your question correctly. If your aim is to stop the workflow for the current user and start from the beginning, then you could use until controller.
More information on this can be found here.

create consolidated build report from multiple jenkins instances

I am having multiple jenkins instances like Jenkins A, Jenkins B and Jenkins C.
Now I am trying to make a report which will have the details about all of the three jenkins at one place.
report about : "Total Build", "Success", "Failed".
( from jenkins A,Jenkins B, Jenkins C)
Is there any shell script which runs on every Jenkins Instances and combine the Script Output at one place?
Make sure anonymous has read access to all your jobs in jenkins. Use powershell to invoke the job's url in the following format
http://jenkinsA:8080/view/viewname/job/jobname/1/console
http://jenkinsA:8080/view/viewname/job/jobname/2/console
http://jenkinsB:8080/view/viewname/job/jobname/1/console
http://jenkinsC:8080/view/viewname/job/jobname/2/console
Keep a count for the number of possible builds for each job. Each time your count is incremented, create an http request in powershell to invoke the url. If the request returns 404, you know the build does not exist and if it is http 200, the build exists. extract the line 'Finished:' which will give you either success or failure.
Based on the results, increment your success or failure count.
Hope it helps!

Run a phantom.js file on Heroku regularly

I've uploaded a single file to Heroku that crawls a website and responds the edited content in JSON format on an http request. I now want to update the content regularly so the content stays up to date. I tried using the Heroku Scheduler however I am failing to schedule the process so that it runs correctly.
I have specified the following process in the Heroku Scheduler:
run phantomjs phantom.js //Using 1X Dyno, every hour.
//phantom.js is the file that contains my source code and that runs the server.
However if I enter
heroku ps
into the terminal, I only see one web dyne running and no scheduler task. Also if I type
heroku logs --ps scheduler.1
as described in the Scheduler documentation, there is no output.
What am I doing wrong? Any help would be appreciated.
For what it sounds like you want to accomplish, you need to be constantly running
1 Web Dyno
1 Background Worker
When your scheduled task executes, it will be run by the background worker. Which, since you haven't provisioned it, isn't executing.
Found it: I only had to write
phantomjs phantom.js
in order to get it working. It was the "run" that made the expression invalid

Resources