Tests are very slow and a lot of time is spent in the wait4() system call #733
Labels
Component: Bash Code
Everything regarding the bash code
Priority: Medium
Wrong or misleading documentation, broken behavior with workaround
Status: Unconfirmend
No reproducer was provided or the reproducer did not work for maintainers.
Type: Bug
Describe the bug
The libgpiod project uses bats for its command-line tools tests. The tests use linux kernel's
gpio-sim
module for mocking up GPIO chips and in general cover the same functionality in shell tools as the GLib tests covering the C library.While it's expected for the C tests to run much faster than bash ones, the bats test-suite is painfully slow - it takes 26 seconds on a regular work laptop to complete vs 0,28 seconds for the C tests on the same machine.
Upon investigation it turned out that the majority of the time in all sub-processes is spent waiting for child processes to exit as evidenced by the following output of
strace -c -f
:This doesn't seem normal and I'd like to request some help in figuring out what's wrong. I'm posting it as a bats issue but it may very well be an issue in how I'm using the framework.
To Reproduce
Steps to reproduce the behavior:
./autogen.sh --enable-tests --enable-tools --enable-gpioset-interactive && make
sudo ./tools/gpio-tools-test
and observe slow execution.Please note that your kernel needs to be built with the gpio-sim module enabled for the tests to work.
Alternatively one can use yocto to build a qemu vm allowing to run these tests without recompiling the kernel - if anyone is interested, I can prepare a repo that would automate the build.
Expected behavior
Tests execute much faster and don't spend ~92% of time in
wait4()
.Environment (please complete the following information):
Tested on two separate environments with same results - one was a regular Ubuntu 23.04 system, the other was a custom Yocto based distro.
1.8.2
and1.9.0
respectively.bash --version
:5.2.15
The text was updated successfully, but these errors were encountered: