To work around another problem (EAI_AGAIN errors when pushing or running unit tests in a newly created scratch org from Jenkins CI using SFDX), I'd like to (gently) poll for the test results produced by
sfdx force:apex:test:run to see if that helps. But the following command does not appear to be designed for that purpose.
The closest I can get is:
sfdx force:apex:test:report --testrunid 707K000001JUhgY --json --wait 2
but the result of that isn't JSON but rather the message:
Socket timeout occurred while listening for results.
and the exit status is 1, just as it is for other error conditions.
Is there an alternate, clean way, to poll say once every 30 seconds?
(Unanswered here Waiting for Test Report from Salesforce DX CLI.)