[gnome-continuous] testbase: make test timeout configurable



commit fb7ea4070eee31cbae754ec5c4ef3c8168da97c5
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Tue Apr 29 14:54:09 2014 +0200

    testbase: make test timeout configurable
    
    This allows us to set different timeouts for smoketest (5 mins)
    and integrationtest (1hr)

 src/js/tasks/task-integrationtest.js |    2 ++
 src/js/tasks/testbase.js             |   11 ++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/js/tasks/task-integrationtest.js b/src/js/tasks/task-integrationtest.js
index 1b4b83a..d21e806 100644
--- a/src/js/tasks/task-integrationtest.js
+++ b/src/js/tasks/task-integrationtest.js
@@ -56,6 +56,8 @@ const TaskIntegrationTest = new Lang.Class({
     StatusMessageID: "4d013788dd704743b826436c951e551d",
 
     CompletedTag: 'integrated',
+
+    Timeout: 60 * 60,
     
     _handleMessage: function(message, cancellable) {
         let gdtrTest = message['GDTR_TEST'];
diff --git a/src/js/tasks/testbase.js b/src/js/tasks/testbase.js
index 89274ec..9a2e503 100644
--- a/src/js/tasks/testbase.js
+++ b/src/js/tasks/testbase.js
@@ -32,8 +32,6 @@ const LibQA = imports.libqa;
 const JSUtil = imports.jsutil;
 const JSONUtil = imports.jsonutil;
 
-const TIMEOUT_SECONDS = 30 * 60;
-
 const CommandSocketIface = '<node> \
 <interface name="org.gnome.Continuous.Command"> \
     <method name="AsyncMessage"> \
@@ -73,12 +71,13 @@ const CommandSocketProxy = new Lang.Class({
 const TestOneDisk = new Lang.Class({
     Name: 'TestOneDisk',
 
-    _init: function(parentTask, testRequiredMessageIds, testFailedMessageIds, testStatusMessageId, 
testGdmSession) {
+    _init: function(parentTask, testRequiredMessageIds, testFailedMessageIds, testStatusMessageId, 
testGdmSession, timeout) {
         this._parentTask = parentTask;
         this._testRequiredMessageIds = testRequiredMessageIds;
         this._testFailedMessageIds = testFailedMessageIds;
         this._statusMessageId = testStatusMessageId;
         this._gdmSession = testGdmSession;
+        this._timeout = timeout;
     },
 
     _fail: function(message) {
@@ -499,7 +498,7 @@ const TestOneDisk = new Lang.Class({
 
         let commandConnectAttemptTimeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 1,
                                                                       Lang.bind(this, 
this._tryCommandConnection));
-        let timeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, TIMEOUT_SECONDS,
+        let timeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, this._timeout,
                                                  Lang.bind(this, this._onTimeout));
 
         // Let's only do a screenshot every 3 seconds, I think it's slowing things down...
@@ -547,6 +546,7 @@ const TestBase = new Lang.Class({
 
     TestTrees: ['-runtime'],
     CompleteIdleWaitSeconds: 10,
+    Timeout: 5 * 60,
 
     BaseRequiredMessageIDs: ["39f53479d3a045ac8e11786248231fbf", // graphical.target 
                              "f77379a8490b408bbe5f6940505a777b",  // systemd-journald
@@ -630,7 +630,8 @@ const TestBase = new Lang.Class({
                                        this.BaseRequiredMessageIDs.concat(this.RequiredMessageIDs),
                                        this.BaseFailedMessageIDs.concat(this.FailedMessageIDs),
                                        this.StatusMessageID,
-                                       this.GdmSession);
+                                       this.GdmSession,
+                                       this.Timeout);
             test.execute(this.subworkdir, this._buildData, this.repo, currentImages.get_child(name), 
cancellable);
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]