Jmeter not executing script from command line (CLI mode) but works fine with GUI mode - testing

I wrote a script in Jmeter that is fine being executed from GUI mode but will fail when being executed from CLI mode (non-GUI)
This is the result from CLI mode:
D:\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin>jmeter -n -t
D:\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin\homepage.jmx Creating
summariser Created the tree successfully using
D:\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin\homepage.jmx Starting
standalone test # Fri Mar 18 09:41:02 EET 2022 (1647589262323) Waiting
for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port
4445 summary + 1 in 00:00:00 = 25.0/s Avg: 0 Min: 0
Max: 0 Err: 1 (100.00%) Active: 1 Started: 1 Finished: 0
summary + 19 in 00:00:05 = 4.0/s Avg: 0 Min: 0 Max:
0 Err: 19 (100.00%) Active: 0 Started: 20 Finished: 20 summary =
20 in 00:00:05 = 4.2/s Avg: 0 Min: 0 Max: 0 Err: 20
(100.00%) Tidying up ... # Fri Mar 18 09:41:07 EET 2022
(1647589267321) ... end of run
Why is this happening and how can i fix it ?
Thanks

You're just running your test without storing the results and from the output it seems that all your 20 requests have failed.
I would recommend re-running your test providing the path to the .jtl results file as a parameter like:
jmeter -n -t D:\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin\homepage.jmx -l result.jtl
and then inspect the result.jtl file using Excel or equivalent or generate HTML Reporting Dashboard out of it, you will see at least response code and message.

Related

Selenium-side-runner failing with `New window did not appear before timeout`

I am trying to run a selenium IDE script (.side) from the command line using side-runner. Currently, the test runs successfully from the IDE, and appears to work successfully from the command line but then fails, throwing: New window did not appear before timeout.
This is my Selenium IDE test. The test is included in the default suite so it should be run. However, when I run it from the command line with:
$ selenium-side-runner -c "browserName=firefox" firefox-test.side
I get:
info: Running firefox-test.side
FAIL ./DefaultSuite.test.js (12.71s)
Default Suite
✕ wikipedia (9332ms)
● Default Suite › wikipedia
New window did not appear before timeout
5 | return hndls.find(h => (!handles.includes(h)));
6 | }
> 7 | throw new Error("New window did not appear before timeout");
| ^
8 | }
9 |
10 | module.exports = {
at Object.waitForWindow (utils.js:7:9)
at Object.<anonymous>.tests.wikipedia (commons.js:34:18)
at Object.<anonymous> (DefaultSuite.test.js:11:5)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 13.353s
Ran all test suites.
However, I can see the firefox window and the tests appear to be working. The window closes, then a new firefox window appears and the error is thrown. I have tried increasing the timeout:
$ selenium-side-runner --timeout 600000 -c "browserName=firefox" firefox-test.side
with the same error. Any ideas?

Filebeat not read all logs from directory

I am configuring filebeat to send to elastic logs located in /var/log/myapp/batch_*
Here my filebeat configuration:
# Version
filebeat version 7.11.0 (amd64), libbeat 7.11.0 [84c4d4c4034fcb49c1a318ccdc7311d70adee15b built 2021-02-08 22:42:11 +0000 UTC]
# Filebeat config
logging.metrics.period: 1h
logging.to_files: true
logging.files:
rotateeverybytes: 16777216
keepfiles: 7
permissions: 0600
filebeat.inputs:
- type: log
enabled: true
scan_frequency: 5m
paths:
- "/var/log/myapp/batch_*"
output.elasticsearch:
hosts: ["server:9200"]
index: "log_test_app-%{+yyyy.MM.dd}"
setup.ilm.enabled: false
setup.template.name: "log_test_app"
setup.template.pattern: "log_test_app-*"
setup.template.overwrite: false
setup.template.settings:
index.number_of_shards: 3
index.number_of_replicas: 1
I only see that two logs are being sent and within the established directory there are a total of eight logs:
2022-05-24T19:39:55.904Z INFO log/input.go:157 Configured paths: [/var/log/myapp/batch_*]
2022-05-24T19:39:55.904Z INFO [crawler] beater/crawler.go:141 Starting input (ID: 3328309751929357009)
2022-05-24T19:39:55.904Z INFO [crawler] beater/crawler.go:108 Loading and starting Inputs completed. Enabled inputs: 1
2022-05-24T19:44:55.905Z INFO log/harvester.go:302 Harvester started for file: /var/log/myapp/batch_emails.log
2022-05-24T19:44:55.905Z INFO log/harvester.go:302 Harvester started for file: /var/log/loyalty/batch_import.log
I show you a list of directory files:
ls -l /var/log/loyalty/batch_*
-rw-r--r-- 1 batch batch 154112 May 24 03:20 /var/log/myapp/batch_gifts.log
-rw-r--r-- 1 batch batch 112319 May 24 02:30 /var/log/myapp/batch_http.log
-rw-r--r-- 1 batch batch 7575342 May 24 02:30 /var/log/myapp/batch_vouchers.log
-rw-r--r-- 1 batch batch 4847849 May 24 19:30 /var/log/myapp/batch_ftp.log
-rw-r--r-- 1 batch batch 99413 May 24 03:40 /var/log/myapp/batch_category.log
-rw-r--r-- 1 root root 367207 May 24 19:50 /var/log/myapp/batch_emails.log
-rw-r--r-- 1 batch batch 479 Jan 1 23:00 /var/log/myapp/batch_history.log
-rw-r--r-- 1 batch batch 2420916 Jan 1 23:00 /var/log/myapp/batch_lists.php
-rw-r--r-- 1 batch batch 25779499 May 24 19:50 /var/log/myapp/batch_import.log
Is there something wrong with my setup? I tried using the ignore_older parameter: 36h but only two log files are processed.
Thanks for the help.
Welcome to stack overflow, Emanuel :)
I believe you are reading only the log files (*.log) thus you can mention the same.
filebeat.inputs:
- type: log
enabled: true
scan_frequency: 5m
paths:
- "/var/log/myapp/batch_*.log"
Keep Posted!!! Thanks!!!

Error when running cwl wrapper from documentation

While running the CWL support example from snakemake documentation:
https://snakemake.readthedocs.io/en/stable/snakefiles/modularization.html#common-workflow-language-cwl-support
I get the following error output,
(snakemake) pedro#Gen83-ubuntu:~/projects/sandbox/cwl-test$ snakemake -j12 "mapped/foo.sorted.bam"
Building DAG of jobs...
Using shell: /bin/bash
Provided cores: 12
Rules claiming more threads will be scaled down.
Job stats:
job count min threads max threads
------------- ------- ------------- -------------
samtools_sort 1 8 8
total 1 8 8
Select jobs to execute...
[Wed Oct 20 11:20:03 2021]
rule samtools_sort:
input: mapped/foo.unsorted.bam
output: mapped/foo.sorted.bam
jobid: 0
wildcards: sample=foo
threads: 8
resources: tmpdir=/tmp
/usr/bin/cwltool 1.0.20180302231433
I'm sorry, I couldn't load this CWL file, try again with --debug for more information.
The error was: mapping values are not allowed here
in "https://github.com/common-workflow-language/workflows/blob/fb406c95/tools/samtools-sort.cwl", line 137, column 65
The Snakefile is almost a copy-paste of the documentation code:
rule samtools_sort:
input:
input="mapped/{sample}.unsorted.bam"
output:
output_name="mapped/{sample}.sorted.bam"
params:
threads=lambda wildcards, threads: threads,
memory="4G"
threads: 8
cwl:
"https://github.com/common-workflow-language/workflows/blob/"
"fb406c95/tools/samtools-sort.cwl"
Snakemake and cwltool version in the conda envinronment are,
(snakemake) pedro#Gen83-ubuntu:~/projects/sandbox/cwl-test$ cwltool --version
/usr/bin/cwltool 1.0.20180302231433
(snakemake) pedro#Gen83-ubuntu:~/projects/sandbox/cwl-test$ snakemake --version
6.9.1
How can run this example successfully?
In case anyone else has the same problem, turns out the problem was the "blob" in the cwl URL, which should be "raw" instead.
...
cwl:
"https://github.com/common-workflow-language/workflows/raw/"
"fb406c95/tools/samtools-sort.cwl"
should work.

Why does my script not work on FreeBSD? (awk: syntax error)

Why does this script not work on FreeBSD? I ran the script on Centos and Debian, all was fine. On FreeBSD (10.2) I encounter the following error:
awk: syntax error at source line 1
context is
match($0, "^listen >>> queue:[[:space:]]+(.*)", <<<
awk: bailing out at source line 1
-0.9902
As an example, here is some output of php-form status:
pool: www
process manager: ondemand
start time: 29/Feb/2016:15:18:54 +0200
start since: 2083770
accepted conn: 1467128
listen queue: 0
max listen queue: 129
listen queue len: 128
idle processes: 1
active processes: 2
total processes: 3
max active processes: 64
max children reached: 1
slow requests: 0
On Centos and Debian, when I run:
/path/to/script/php-fpm-check.sh "idle processes" http://127.0.0.1/status
I get 1, but on FreeBSD the error mentioned above.
The 3-argument form of match is a GNU awk extension (docs). You'll have to find another way to capture the match (perhaps using the RSTART and RLENGTH variables set as a side-effect of match()), or install gawk on your freebsd system.

test-geoip.exe test fails on the last 2 tests

I have built the geoip-c-api using msys2 and mingw-w64 and after i am runing test-geoip.exe
It gives me those 2 lines in the error log how i can fix it? Why it's happening?
And my OS is Windows 7 64Bit also the api build is 64bit
also note when i was building it was done with no error
======================================
GeoIP 1.6.3: test/test-suite.log
======================================
# TOTAL: 1
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
FAIL: test-geoip
================
Test addr 99 yahoo.com failed, got (null), expected US
Test addr 198 yahoo.com failed, got (null), expected US