ITEKeyboard LED creation fails
This blocks !102 (merged). I'm not sure where this bug is, but it's reproducible (in the CI at least) and reliably so, see this job here.
The failure is in TestITEKeyboard.test_creation
during our handling of the LED
class. The source of the issue is that this code is called with a udev event that contains a nonexisting syspath for the input node, so opening the various LED files fails. So basically:
- we get a udev event for
/sys/.../input5/input5::capslock
- we try to open
/sys/.../input5::capslock/max_brightness
- boom, because
/sys/../input5/
doesn't exist
I'm not sure why this is the case, but debugging shows it's the input node itself that's missing (/sys/.../input/input5
), not just the LED nodes. I'ts not a timing issue, a sleep(0.5)
still has the files missing. It does seem to be some larger issue in that it happens for multiple nodes, it's just the LED handling that causes it to fail.
From the debugging output:
__ udev event add syspath /sys/devices/virtual/misc/uhid/0003:06CB:2968.0001
UDEV EVENT "add" for /sys/devices/virtual/misc/uhid/0003:06CB:2968.0001
UDEV add object: Device('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001')
Files in new object: [PosixPath('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/uevent'), PosixPath('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/report_descriptor'), PosixPath('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/power'), PosixPath('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/driver'), PosixPath('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/subsystem'), PosixPath('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/input'), PosixPath('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/hidraw'), PosixPath('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/country'), PosixPath('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/modalias')]
So the parent object is fine, but the uevent handling for the input node:
__ udev event add syspath /sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/input/input6
UDEV EVENT "add" for /sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/input/input6
UDEV add object: Device('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/input/input6')
.. /sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/input/input6 not found, trying again
... nope, still not there
The last line happens after the 500ms sleep. This output is for input6
which we apparently don't care about. Where it fails is a bit later for the capslock LED on input5
.
UDEV EVENT "add" for /sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/input/input5/input5::capslock
UDEV add object: Device('/sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/input/input5/input5::capslock')
.. /sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/input/input5/input5::capslock not found, trying again
... nope, still not there
........... LED EVENT
udev object sys path: /sys/devices/virtual/misc/uhid/0003:06CB:2968.0001/input/input5/input5::capslock
Which triggers the FileNotFound
during some iterdir()
debug printing. Before the debug printing it'd fail when trying to open max_brightness
.
What's going on here?