VirtualBox

Ignore:
Timestamp:
Mar 16, 2020 8:13:27 AM (5 years ago)
Author:
vboxsync
Message:

ValidationKit/testdriver: Fixed exceptions where removing PIDs in actionAbort() will in result in RuntimeErrors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testdriver/base.py

    r82968 r83294  
    15881588                    time.sleep(1);
    15891589
     1590                dPidsToRemove = []; # Temporary dict to append PIDs to remove later.
     1591
    15901592                for iPid in dPids:
    15911593                    if not processExists(iPid):
    15921594                        reporter.log('%s (%s) terminated' % (dPids[iPid][0], iPid,));
    15931595                        self.pidFileRemove(iPid, fQuiet = True);
    1594                         del dPids[iPid];
     1596                        dPidsToRemove.append(iPid);
     1597                        continue;
     1598
     1599                # Remove PIDs from original dictionary, as removing keys from a
     1600                # dictionary while iterating on it won't work and will result in a RuntimeError.
     1601                for iPidToRemove in dPidsToRemove:
     1602                    del dPids[iPidToRemove];
    15951603
    15961604                if not dPids:
     
    18111819    unittest.main();
    18121820    # not reached.
    1813 
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