VirtualBox

Changeset 91428 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 28, 2021 9:23:40 AM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: When executing host binaries, send output directly to stdout instead of piping (and waiting for) it. ​bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/audio/tdAudioTest.py

    r91426 r91428  
    3939import signal
    4040import subprocess
    41 import time
    4241
    4342# Only the main script needs to modify the path.
     
    271270            oProcess = utils.sudoProcessPopen(asArgs,
    272271                                              env = asEnvTmp,
    273                                               stdout = subprocess.PIPE, stderr = subprocess.PIPE, shell = False,
     272                                              stdout = sys.stdout, stderr = sys.stdout,
    274273                                              close_fds = False);
    275274        else:
    276275            oProcess = utils.processPopenSafe(asArgs,
    277276                                              env = asEnvTmp,
    278                                               stdout = subprocess.PIPE, stderr = subprocess.PIPE);
     277                                              stdout = sys.stdout, stderr = sys.stdout);
    279278        if oProcess:
    280             for line in iter(oProcess.stdout.readline, b''):
    281                 reporter.log('[' + sWhat + '] ' + line.decode('utf-8'));
    282                 self.processPendingEvents();
    283                 time.sleep(0.01); # Don't hog the CPU too much.
    284             oProcess.communicate();
    285             if oProcess.returncode == 0:
     279            self.pidFileAdd(oProcess.pid, sWhat, fSudo = fAsAdmin);
     280            iRc = oProcess.wait();
     281            self.pidFileRemove(oProcess.pid);
     282
     283            if iRc == 0:
     284                reporter.log('*** %s: exit code %d' % (sWhat, iRc));
    286285                fRc = True;
    287286            else:
    288                 reporter.log2('Executing \"%s\" on host returned exit code error %d' % (sWhat, oProcess.returncode));
     287                reporter.log('!*! %s: exit code %d' % (sWhat, iRc));
    289288
    290289        return fRc;
     
    302301
    303302        reporter.testStart(sWhat);
     303
     304        try:    sys.stdout.flush();
     305        except: pass;
     306        try:    sys.stderr.flush();
     307        except: pass;
    304308
    305309        fRc = self.executeHstLoop(sWhat, asArgs, asEnv);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette