Skip to content
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

meson.build: increase timeout of pytest test #675

Closed
wants to merge 1 commit into from

Conversation

alyssais
Copy link

Running pytest can take a while, especially if the system is already under load (for example, if it's building other packages at the same time as libwacom). Recently, I saw it take 82 seconds.

@whot
Copy link
Member

whot commented Apr 29, 2024

Recently, I saw it take 82 seconds.

This seems odd, my system here (not a particularly fast one...) finishes in under 4 seconds. I'd understand double that or triple that if the machine is under load but 82 seconds feels very wrong.

There is one instance where it's asking for the password though (during test_hwdb_files I think) so maybe it's just hanging in that test?

@alyssais
Copy link
Author

alyssais commented May 3, 2024

It did eventually pass after 82 seconds — would that be expected if it was hanging?

@whot
Copy link
Member

whot commented May 3, 2024

tbh I don't know how long the timeout would be. If you run it as pytest -v what does the output look like? Do you see where it's hanging?

@whot
Copy link
Member

whot commented May 7, 2024

fwiw, e4ea346 may help too with the timeouts.

@alyssais
Copy link
Author

alyssais commented May 7, 2024

I'll try it next time I'm building libwacom — thanks!

@whot
Copy link
Member

whot commented May 14, 2024

Apologies, this is indeed an issue with the tests, I just didn't noticed because I either ran a subset of them or they all got skipped. Short answer: running systemd-hwdb and others on every test run is simply slow, so the whole test_udev_rules.py file takes forever.

Running pytest can take a while, especially if the system is already
under load (for example, if it's building other packages at the same
time as libwacom).  Recently, I saw it take 82 seconds.
whot added a commit to whot/libwacom that referenced this pull request May 14, 2024
Previously we'd create a uinput device for each of our tablets, then
query udev if the property is set. This takes a long time, in parts
thanks to the 300ms sleep to wait for the uinput device to be ready.

With now over 500 tablet files and most of those having multiple matches
we're looking at at minimum 500*0.3 seconds for a test run which isn't
really useful for a test like this.

Instead - let's query systemd-hwdb directly: construct a query string
our udev rule and query systemd-hwdb for the properties, then ensure we
have the ones we expect.

Closes linuxwacom#675
whot added a commit to whot/libwacom that referenced this pull request May 14, 2024
Previously we'd create a uinput device for each of our tablets, then
query udev if the property is set. This takes a long time, in parts
thanks to the 300ms sleep to wait for the uinput device to be ready.

With now over 500 tablet files and most of those having multiple matches
we're looking at at minimum 500*0.3 seconds for a test run which isn't
really useful for a test like this.

Instead - let's query systemd-hwdb directly: construct a query string
our udev rule and query systemd-hwdb for the properties, then ensure we
have the ones we expect.

Closes linuxwacom#675
@whot
Copy link
Member

whot commented May 15, 2024

Closing this in favour of #694 which is a better fix since the test suite no longer takes forever with that fix. We might still need a timeout (e.g. it can take 22s on my machine which is close to the 30s timeout) but we shouldn't need a huge increase.

@whot whot closed this May 15, 2024
whot added a commit to whot/libwacom that referenced this pull request May 16, 2024
Previously we'd create a uinput device for each of our tablets, then
query udev if the property is set. This takes a long time, in parts
thanks to the 300ms sleep to wait for the uinput device to be ready.

With now over 500 tablet files and most of those having multiple matches
we're looking at at minimum 500*0.3 seconds for a test run which isn't
really useful for a test like this.

Instead - let's query systemd-hwdb directly: construct a query string
our udev rule and query systemd-hwdb for the properties, then ensure we
have the ones we expect.

Closes linuxwacom#675
whot added a commit to whot/libwacom that referenced this pull request May 16, 2024
Previously we'd create a uinput device for each of our tablets, then
query udev if the property is set. This takes a long time, in parts
thanks to the 300ms sleep to wait for the uinput device to be ready.

With now over 500 tablet files and most of those having multiple matches
we're looking at at minimum 500*0.3 seconds for a test run which isn't
really useful for a test like this.

Instead - let's query systemd-hwdb directly: construct a query string
our udev rule and query systemd-hwdb for the properties, then ensure we
have the ones we expect.

Closes linuxwacom#675
whot added a commit to whot/libwacom that referenced this pull request May 16, 2024
Previously we'd create a uinput device for each of our tablets, then
query udev if the property is set. This takes a long time, in parts
thanks to the 300ms sleep to wait for the uinput device to be ready.

With now over 500 tablet files and most of those having multiple matches
we're looking at at minimum 500*0.3 seconds for a test run which isn't
really useful for a test like this.

Instead - let's query systemd-hwdb directly: construct a query string
our udev rule and query systemd-hwdb for the properties, then ensure we
have the ones we expect.

Closes linuxwacom#675
whot added a commit that referenced this pull request May 16, 2024
Previously we'd create a uinput device for each of our tablets, then
query udev if the property is set. This takes a long time, in parts
thanks to the 300ms sleep to wait for the uinput device to be ready.

With now over 500 tablet files and most of those having multiple matches
we're looking at at minimum 500*0.3 seconds for a test run which isn't
really useful for a test like this.

Instead - let's query systemd-hwdb directly: construct a query string
our udev rule and query systemd-hwdb for the properties, then ensure we
have the ones we expect.

Closes #675
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants