Reduce likelihood of indefinite wait in viewer integration tests.
Introduce LLStartupListener to allow viewerclient-based test script to query startup state. This handles the scenario in which, by the time the test script manages to connect, the viewer already IS in STATE_STARTED. Fix ViewerSession to invoke that query before waiting for STATE_STARTED. Make that wait time out eventually to deal with "System currently logging you off, please wait 5 minutes." Timeout raises new ViewerWontLogin exception. Fix testlangs to catch ViewerWontLogin and retry a limited number of times.meow-7.2.2
parent
724cbb8134
commit
adc975ff91
|
|
@ -389,6 +389,7 @@ set(viewer_SOURCE_FILES
|
|||
llsplitbutton.cpp
|
||||
llsprite.cpp
|
||||
llstartup.cpp
|
||||
llstartuplistener.cpp
|
||||
llstatusbar.cpp
|
||||
llstylemap.cpp
|
||||
llsurface.cpp
|
||||
|
|
@ -891,6 +892,7 @@ set(viewer_HEADER_FILES
|
|||
llsplitbutton.h
|
||||
llsprite.h
|
||||
llstartup.h
|
||||
llstartuplistener.h
|
||||
llstatusbar.h
|
||||
llstylemap.h
|
||||
llsurface.h
|
||||
|
|
|
|||
|
|
@ -193,6 +193,7 @@
|
|||
|
||||
#include "lllogin.h"
|
||||
#include "llevents.h"
|
||||
#include "llstartuplistener.h"
|
||||
|
||||
#if LL_WINDOWS
|
||||
#include "llwindebug.h"
|
||||
|
|
@ -241,7 +242,8 @@ static std::string gFirstSimSeedCap;
|
|||
static LLVector3 gAgentStartLookAt(1.0f, 0.f, 0.f);
|
||||
static std::string gAgentStartLocation = "safe";
|
||||
|
||||
static LLEventStream sStartupStateWatcher("StartupState");
|
||||
boost::scoped_ptr<LLEventPump> LLStartUp::sStateWatcher(new LLEventStream("StartupState"));
|
||||
boost::scoped_ptr<LLStartupListener> LLStartUp::sListener(new LLStartupListener());
|
||||
|
||||
//
|
||||
// local function declaration
|
||||
|
|
@ -2725,10 +2727,15 @@ void LLStartUp::setStartupState( EStartupState state )
|
|||
getStartupStateString() << " to " <<
|
||||
startupStateToString(state) << LL_ENDL;
|
||||
gStartupState = state;
|
||||
postStartupState();
|
||||
}
|
||||
|
||||
void LLStartUp::postStartupState()
|
||||
{
|
||||
LLSD stateInfo;
|
||||
stateInfo["str"] = getStartupStateString();
|
||||
stateInfo["enum"] = state;
|
||||
sStartupStateWatcher.post(stateInfo);
|
||||
stateInfo["enum"] = gStartupState;
|
||||
sStateWatcher->post(stateInfo);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,11 @@
|
|||
#ifndef LL_LLSTARTUP_H
|
||||
#define LL_LLSTARTUP_H
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
class LLViewerTexture ;
|
||||
class LLEventPump;
|
||||
class LLStartupListener;
|
||||
|
||||
// functions
|
||||
bool idle_startup();
|
||||
|
|
@ -113,9 +117,13 @@ public:
|
|||
// *HACK: On startup, if we were passed a secondlife://app/do/foo
|
||||
// command URL, store it for later processing.
|
||||
|
||||
static void postStartupState();
|
||||
|
||||
private:
|
||||
static std::string startupStateToString(EStartupState state);
|
||||
static EStartupState gStartupState; // Do not set directly, use LLStartup::setStartupState
|
||||
static boost::scoped_ptr<LLEventPump> sStateWatcher;
|
||||
static boost::scoped_ptr<LLStartupListener> sListener;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
/**
|
||||
* @file llstartuplistener.cpp
|
||||
* @author Nat Goodspeed
|
||||
* @date 2009-12-08
|
||||
* @brief Implementation for llstartuplistener.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewergpl$
|
||||
* Copyright (c) 2009, Linden Research, Inc.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
// Precompiled header
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
// associated header
|
||||
#include "llstartuplistener.h"
|
||||
// STL headers
|
||||
// std headers
|
||||
// external library headers
|
||||
// other Linden headers
|
||||
#include "llstartup.h"
|
||||
|
||||
|
||||
LLStartupListener::LLStartupListener(/* LLStartUp* instance */):
|
||||
LLEventAPI("LLStartUp", "Access e.g. LLStartup::postStartupState()") /* ,
|
||||
mStartup(instance) */
|
||||
{
|
||||
add("postStartupState", "Refresh \"StartupState\" listeners with current startup state",
|
||||
&LLStartupListener::postStartupState);
|
||||
}
|
||||
|
||||
void LLStartupListener::postStartupState(const LLSD&) const
|
||||
{
|
||||
LLStartUp::postStartupState();
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* @file llstartuplistener.h
|
||||
* @author Nat Goodspeed
|
||||
* @date 2009-12-07
|
||||
* @brief Event API to provide access to LLStartUp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewergpl$
|
||||
* Copyright (c) 2009, Linden Research, Inc.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#if ! defined(LL_LLSTARTUPLISTENER_H)
|
||||
#define LL_LLSTARTUPLISTENER_H
|
||||
|
||||
#include "lleventapi.h"
|
||||
class LLStartUp;
|
||||
class LLSD;
|
||||
|
||||
class LLStartupListener: public LLEventAPI
|
||||
{
|
||||
public:
|
||||
LLStartupListener(/* LLStartUp* instance */); // all static members!
|
||||
|
||||
private:
|
||||
void postStartupState(const LLSD&) const;
|
||||
|
||||
//LLStartup* mStartup;
|
||||
};
|
||||
|
||||
#endif /* ! defined(LL_LLSTARTUPLISTENER_H) */
|
||||
Loading…
Reference in New Issue