-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
Comments
I'd be interested in the yocto build for qemu to reproduce this. |
martin-schulze-vireso
added
Priority: Medium
Wrong or misleading documentation, broken behavior with workaround
Status: Unconfirmend
No reproducer was provided or the reproducer did not work for maintainers.
Component: Bash Code
Everything regarding the bash code
and removed
Priority: NeedsTriage
Issue has not been vetted yet
labels
Jun 3, 2023
@martin-schulze-vireso Here you go Let me know if anything is missing from the README |
I think this may just be the way bats works - running the bats' own test-suite results in a very similar strace output:
|
That may well be but maybe we can improve Bats runtime... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: