-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test: only skip slow tests on Raspberry Pi devices #42645
Conversation
// the contents of `/sys/firmware/devicetree/base/model` but that doesn't | ||
// work inside a container. Match the chipset model number instead. | ||
const cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }); | ||
return /^Hardware\s*:\s*(.*)$/im.exec(cpuinfo)?.[1] === 'BCM2835'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: BCM2835
matches what /proc/cpuinfo
returns on the Pi 2's and 3's in our CI.
e.g.
Pi 3
$ docker exec node-ci-stretch cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 1
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 2
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 3
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 76.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
Hardware : BCM2835
Revision : a22082
Serial : 000000001acb5e3f
Model : Raspberry Pi 3 Model B Rev 1.2
Pi 2:
$ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5
processor : 1
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5
processor : 2
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5
processor : 3
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5
Hardware : BCM2835
Revision : a21041
Serial : 00000000e74d942b
Model : Raspberry Pi 2 Model B Rev 1.1
I haven't matched against other Pi chipsets -- I don't know, for example, whether the Pi 4's are fast enough to run these slow tests (we don't have any in the Node.js CI).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also os.cpus()
doesn't return the Hardware
field:
$ node -p "os.cpus()"
[
{
model: 'ARMv7 Processor rev 4 (v7l)',
speed: 1200,
times: { user: 5251030, nice: 0, sys: 634800, idle: 56307240, irq: 0 }
},
{
model: 'ARMv7 Processor rev 4 (v7l)',
speed: 1200,
times: { user: 5691040, nice: 0, sys: 1000630, idle: 56166190, irq: 0 }
},
{
model: 'ARMv7 Processor rev 4 (v7l)',
speed: 1200,
times: { user: 5880350, nice: 10, sys: 953020, idle: 55968650, irq: 0 }
},
{
model: 'ARMv7 Processor rev 4 (v7l)',
speed: 1200,
times: { user: 5741270, nice: 0, sys: 945350, idle: 56215820, irq: 0 }
}
]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the problem with /sys? It's not available at all or that specific path doesn't exist or ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mscdex That specific path doesn't exist.
pi@test-requireio--williamkapke-debian10-arm64--pi3-3:~ $ docker exec node-ci-stretch ls -al /sys
total 4
dr-xr-xr-x 12 root root 0 Apr 7 01:22 .
drwxr-xr-x 20 root root 4096 Apr 7 01:21 ..
drwxr-xr-x 2 root root 0 Apr 8 01:22 block
drwxr-xr-x 26 root root 0 Apr 8 01:22 bus
drwxr-xr-x 54 root root 0 Apr 8 01:22 class
drwxr-xr-x 4 root root 0 Apr 8 01:22 dev
drwxr-xr-x 11 root root 0 Apr 8 01:16 devices
drwxrwxrwt 2 root root 40 Apr 7 01:22 firmware
drwxr-xr-x 7 root root 0 Apr 7 01:22 fs
drwxr-xr-x 12 root root 0 Apr 8 01:22 kernel
drwxr-xr-x 124 root root 0 Apr 8 01:22 module
drwxr-xr-x 2 root root 0 Apr 8 01:22 power
pi@test-requireio--williamkapke-debian10-arm64--pi3-3:~ $ docker exec node-ci-stretch ls -al /sys/firmware
total 0
drwxrwxrwt 2 root root 40 Apr 7 01:22 .
dr-xr-xr-x 12 root root 0 Apr 7 01:22 ..
pi@test-requireio--williamkapke-debian10-arm64--pi3-3:~ $
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW there should also be /proc/device-tree/model. Not sure if that's better or worse than parsing /proc/cpuinfo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/proc/device-tree
appears to be a symlink inside the container pointing to a non-existent location:
pi@test-requireio--williamkapke-debian10-arm64--pi3-3:~ $ docker exec node-ci-stretch ls -al /proc/device-tree
lrwxrwxrwx 1 root root 29 Apr 8 01:37 /proc/device-tree -> /sys/firmware/devicetree/base
pi@test-requireio--williamkapke-debian10-arm64--pi3-3:~ $ docker exec node-ci-stretch ls -al /proc/device-tree/
ls: cannot access '/proc/device-tree/': No such file or directory
pi@test-requireio--williamkapke-debian10-arm64--pi3-3:~ $
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also moby/moby#43419.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't stop it running on a pi4, but as you said that doesn't matter as we don't have any:
Hardware : BCM2711
Revision : d03114
Serial : 10000000302bfe33
Model : Raspberry Pi 4 Model B Rev 1.4
Similarly the ODROID distributions give their own custom output e.g.
Hardware : Hardkernel ODROID-XU4
Revision : 0100
Serial : 0000000000000000
(FYI I get timeouts in a couple of keepalive tests on that machine which is one of my own dev boxes, but no other timeouts based on the one run I've just done)
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This comment was marked as outdated.
This comment was marked as outdated.
I'm not sure I understand this, because Ampere Altra is based on ARMv8. Is there an emulation layer for armv7l ? |
The Altras have the native 32-bit armv7l instruction set too so they execute the docker containers natively without emulation. Most armv8 systems do however it's not a requirement for the chips to include it (The previous ThunderX aarch64 systems we had were quite unusual in NOT having this support - which is why moving to the Altras was what allowed us to run these containers) Surprisingly (at least to me) Apple's M1 CPUs also seem to include the armv7l instructions - I wouldn't have thought they'd have bothered ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be worth adjusting the messages etc. to clarify that it will affect the older generation pis only, but for the purposes of our CI I'm equally happy to leave this as-is.
Detect the Raspberry Pi devices in the Node.js CI and only skip the slow tests on those instead of all armv7l devices.
Updated to pick up (and change) the new test from #42409. |
Detect the Raspberry Pi devices in the Node.js CI and only skip the slow tests on those instead of all armv7l devices. PR-URL: #42645 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Stewart X Addison <sxa@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Landed in 73d53fe |
Detect the Raspberry Pi devices in the Node.js CI and only skip the slow tests on those instead of all armv7l devices. PR-URL: nodejs#42645 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Stewart X Addison <sxa@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Detect the Raspberry Pi devices in the Node.js CI and only skip the slow tests on those instead of all armv7l devices. PR-URL: nodejs#42645 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Stewart X Addison <sxa@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Detect the Raspberry Pi devices in the Node.js CI and only skip the slow tests on those instead of all armv7l devices. PR-URL: #42645 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Stewart X Addison <sxa@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Detect the Raspberry Pi devices in the Node.js CI and only skip the slow tests on those instead of all armv7l devices. PR-URL: #42645 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Stewart X Addison <sxa@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Detect the Raspberry Pi devices in the Node.js CI and only skip the slow tests on those instead of all armv7l devices. PR-URL: #42645 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Stewart X Addison <sxa@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Detect the Raspberry Pi devices in the Node.js CI and only skip the slow tests on those instead of all armv7l devices. PR-URL: #42645 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Stewart X Addison <sxa@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Detect the Raspberry Pi devices in the Node.js CI and only skip the slow tests on those instead of all armv7l devices. PR-URL: nodejs/node#42645 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Stewart X Addison <sxa@redhat.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Detect the Raspberry Pi devices in the Node.js CI and only skip the
slow tests on those instead of all armv7l devices.
For some more background we recently added an additional node-test-binary-armv7l job to node-test-commit-arm-fanned (nodejs/build#2914 (comment)) which runs the cross-compiled armv7l binaries in armv7l containers on the Ampere Altras donated to the project via the Works on Arm program at Equinix. These are fast enough to run the tests that are too slow to run on actual Pi hardware.