Adds a hybrid stress test (multithreading, nonblocking, short timeouts, localhost broker only) that is intended to be used with default BSD socket interface, or --enable-curl. Also fixes some minor issues found from stress testing so far.
New stress test:
Added stress test script scripts/stress.test, with default 250ms timeout.
Added convenience stress test build option --enable-stress. The --enable-stress enables nonblocking, multithreading, and adds defines for TEST_NONBLOCK and multithreading. Also forces the multithreading example to be localhost mosquitto broker only.
Stress build takes optional args for num threads and pubs per thread. E.g. --enable-stress=t7,p8 will do 7 threads and 8 pubs per thread.
Cleanup, small fixes, and enhancements:
Add missing reinitialization of fd_set in SOCK_RECV while loop in BSD Socket TCP example examples/mqttnet.c.
Updated curl example in examples/mqttnet.c to use WOLFMQTT_TEST_NONBLOCK and WOLFMQTT_TEST_NONBLOCK_TIMES.
Refactor some tcp code in examples/mqttnet.c.
Cleanup and refactor duplicate code in test shell scripts.
Cleaned up some trailing whitespace and misc things.
Testing
Added stress test to ubuntu-check and ubuntu-check-curl workflows.
Notes
The timeout in scripts/stress.test is configurable, e.g. for 50ms timeout:
./scripts/stress.test 50
Issues
--enable-stress=t10,p8 with either BSD sockets or curl will fail often, with random errors (malformed packet, out of buffer, -200 unknown, unknown packet identifier, etc).
Description
Adds a hybrid stress test (multithreading, nonblocking, short timeouts, localhost broker only) that is intended to be used with default BSD socket interface, or
--enable-curl
. Also fixes some minor issues found from stress testing so far.New stress test:
scripts/stress.test
, with default 250ms timeout.--enable-stress
. The--enable-stress
enables nonblocking, multithreading, and adds defines for TEST_NONBLOCK and multithreading. Also forces the multithreading example to be localhost mosquitto broker only.--enable-stress=t7,p8
will do 7 threads and 8 pubs per thread.Cleanup, small fixes, and enhancements:
examples/mqttnet.c
.examples/mqttnet.c
to useWOLFMQTT_TEST_NONBLOCK
andWOLFMQTT_TEST_NONBLOCK_TIMES
.examples/mqttnet.c
.Testing
Notes
The timeout in
scripts/stress.test
is configurable, e.g. for 50ms timeout:Issues
--enable-stress=t10,p8
with either BSD sockets or curl will fail often, with random errors (malformed packet, out of buffer, -200 unknown, unknown packet identifier, etc).