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

test: only skip slow tests on Raspberry Pi devices #42645

Closed
wants to merge 1 commit into from

Conversation

richardlau
Copy link
Member

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.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Apr 7, 2022
// 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';
Copy link
Member Author

@richardlau richardlau Apr 7, 2022

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).

Copy link
Member Author

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 }
  }
]

Copy link
Contributor

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 ?

Copy link
Member Author

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:~ $

Copy link
Contributor

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

Copy link
Member Author

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:~ $

Copy link
Member Author

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.

Copy link
Member

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)

@richardlau richardlau added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 7, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 7, 2022
@nodejs-github-bot

This comment was marked as outdated.

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nodejs-github-bot

This comment was marked as outdated.

@richardlau richardlau added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 8, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 8, 2022
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targos
Copy link
Member

targos commented Apr 8, 2022

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

I'm not sure I understand this, because Ampere Altra is based on ARMv8. Is there an emulation layer for armv7l ?

@sxa
Copy link
Member

sxa commented Apr 8, 2022

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

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 ...

@richardlau richardlau requested a review from sxa April 8, 2022 11:13
Copy link
Member

@sxa sxa left a 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.

@richardlau richardlau added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 8, 2022
Detect the Raspberry Pi devices in the Node.js CI and only skip the
slow tests on those instead of all armv7l devices.
@richardlau
Copy link
Member Author

Updated to pick up (and change) the new test from #42409.

@richardlau richardlau added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 11, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 11, 2022
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

mhdawson pushed a commit that referenced this pull request Apr 12, 2022
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>
@mhdawson
Copy link
Member

Landed in 73d53fe

@mhdawson mhdawson closed this Apr 12, 2022
@richardlau richardlau deleted the detectpi branch April 12, 2022 18:21
vmoroz pushed a commit to vmoroz/node that referenced this pull request Apr 13, 2022
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>
xtx1130 pushed a commit to xtx1130/node that referenced this pull request Apr 25, 2022
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>
juanarbol pushed a commit that referenced this pull request May 31, 2022
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>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
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>
targos pushed a commit that referenced this pull request Jul 12, 2022
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>
targos pushed a commit that referenced this pull request Jul 31, 2022
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>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants