VirtualBox

Changeset 61509 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 6, 2016 10:26:04 PM (9 years ago)
Author:
vboxsync
Message:

testmanager: Simple throttling of failures.

Location:
trunk/src/VBox/ValidationKit/testmanager
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/config.py

    r61251 r61509  
    88__copyright__ = \
    99"""
    10 Copyright (C) 2012-2015 Oracle Corporation
     10Copyright (C) 2012-2016 Oracle Corporation
    1111
    1212This file is part of VirtualBox Open Source Edition (OSE), as
     
    9393
    9494
     95## @name Scheduling parameters
     96## @{
     97
    9598## The time to wait for a gang to gather (in seconds).
    96 g_kcSecGangGathering    = 600;
     99g_kcSecGangGathering                    = 600;
    97100## The max time allowed to spend looking for a new task (in seconds).
    98 g_kcSecMaxNewTask       = 60;
     101g_kcSecMaxNewTask                       = 60;
     102## Minimum time since last task started.
     103g_kcSecMinSinceLastTask                 = 120; # (2 min)
     104## Minimum time since last failed task.
     105g_kcSecMinSinceLastFailedTask           = 180; # (3 min)
     106
     107## @}
     108
    99109
    100110
  • trunk/src/VBox/ValidationKit/testmanager/core/testboxcontroller.py

    r61502 r61509  
    568568        # If idling and enabled try schedule a new task.
    569569        #
    570         if fIdle \
     570        if    fIdle \
    571571          and oTestBoxData.fEnabled \
     572          and not TestSetLogic(oDb).isTestBoxExecutingToRapidly(oTestBoxData.idTestBox) \
    572573          and oStatusData.enmState == TestBoxStatusData.ksTestBoxState_Idle: # (paranoia)
    573574            dResponse = SchedulerBase.scheduleNewTask(oDb, oTestBoxData, oStatusData.iWorkItem, self._oSrvGlue.getBaseUrl());
  • trunk/src/VBox/ValidationKit/testmanager/core/testset.py

    r61480 r61509  
    711711        return aoRet;
    712712
     713    def isTestBoxExecutingToRapidly(self, idTestBox):
     714        """
     715        Checks whether the specified test box is executing tests too rapidly.
     716
     717        The parameters defining too rapid execution are defined in config.py.
     718
     719        Returns True if it does, False if it doesn't.
     720        May raise database problems.
     721        """
     722
     723        self._oDb.execute('(\n'
     724                          'SELECT   tsCreated\n'
     725                          'FROM     TestSets\n'
     726                          'WHERE    idTestBox = %s\n'
     727                          '     AND tsCreated >= (CURRENT_TIMESTAMP - interval \'%s seconds\')\n'
     728                          ') UNION (\n'
     729                          'SELECT   tsCreated\n'
     730                          'FROM     TestSets\n'
     731                          'WHERE    idTestBox = %s\n'
     732                          '     AND tsCreated >= (CURRENT_TIMESTAMP - interval \'%s seconds\')\n'
     733                          '     AND enmStatus >= \'failure\'\n'
     734                          ')'
     735                          , ( idTestBox, config.g_kcSecMinSinceLastTask,
     736                              idTestBox, config.g_kcSecMinSinceLastFailedTask, ));
     737        return self._oDb.getRowCount() > 0;
     738
    713739
    714740    #
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