It wouldn't hurt to run the Apple Hardware Test in loop mode if possible. Diagnostics don't always catch all types of failures though.
To test the GPU, you can try running "" which should mostly focus on the GPU and not the CPU. I haven't had any luck running gputest with the GUI on recent versions of macOS although a co-worker seems to have no problems running it. I usually have to run gputest from the Terminal command line using the following command:
open <path-to-gputest-app> --args '/fullscreen /mpaa=4 /test=fur'
You can just type "open " without the double quotes, then drag & drop the "gputest" app (non-gui version) onto the Terminal to auto-fill the path "<path-to-gputest-app>". For other tests and options open up the shell script (the file ending in ".sh") using TextEdit. One undocumented test which I also like is "/test=pixmark_julia_fp64", but it isn't as strenuous as the "furmark" test listed previously.
open <path-to-gputest-app> --args '/fullscreen /mpaa=4 /test=pixmark_julia_fp64'
You will need to give GateKeeper permission to run the app the first time by going into the Security Setting System Preferences. Press Esc while the test is running in fullscreen to quit the qputest.
Another good way to test the GPU is by downloading several HD trailers and running them in loop mode simultaneously using Quicktime. I like to overlap the various movie windows to make the computer work a bit harder.
Try an and (hold the PRAM reset for at least three chimes).
You can monitor system fans and temperature using.
To stress test the CPU and memory, try running "" in Torture Test mode.
To test just the memory try creating a bootable USB drive using. the USB drive and select the orange icon labeled "EFI". Once Memtest86 is running you can safely remove the USB drive. The latest free version 8.2 unfortunately does not allow running the test for more than four loops. You can download the older free which I believe allows the loops to be increased beyond four. Use the Memtest .img file as the source for Etcher.
[Link Edited by Moderator]