You can try to run the AHT from a USB drive.
see the above link to find/download the AHT for your model.
1) Download the AHT for your computer (see downloads below for
1b) My copy had me convert the downloaded .dmg from some “old” type
using Disk Utility. (Just open the .dmg in Disk Utility and “Convert”
to a new target, then mount the target.)
2) Mount and completely wipe a USB stick.
3) From the AHT image, copy /System to the root folder of your USB
cd /Volumes/USB_STICK/ && cp -r ~/AHT_ARCHIVE/System .
4) Now, from the USB drive, copy the
/System/Library/CoreServices/.diagnostics/diags.efi to the root
cd /Volumes/USB_STICK/ && cp
5) Shutdown all applications.
6) “bless” the USB drive in mount-mode, with the EFI file, and
cd /Volumes/USB_STICK/ && sudo bless --mount /Volumes/USB_STICK
--setBoot --file diags.efi && sudo reboot
7) You should now be booting into AHT -- don’t hold down any keys.
8) Run the tests, and yank the USB key after AHT reboots you.