summaryrefslogtreecommitdiff
path: root/indra/viewer_components/login/tests
AgeCommit message (Collapse)Author
2020-04-03DRTVWR-476: Make LoginListener::waitFor() take arbitrary predicate.Nat Goodspeed
This allows one of the tests to specifically waitFor() the completion status update from LLLogin, rather than the next status update to come along: the coroutine potentially emits a whole sequence of status updates before completion. Then the waitFor() overload that merely waits for the next status update is implemented by passing that specific predicate to the other overload.
2020-04-03DRTVWR-476: Cherry-pick debug aids from commit 77b0c53 (fiber-mutex)Nat Goodspeed
2020-03-25DRTVWR-476: Infrastructure to help manage long-lived coroutines.Nat Goodspeed
Introduce LLCoros::Stop exception, with subclasses Stopping, Stopped and Shutdown. Add LLCoros::checkStop(), intended to be called periodically by any coroutine with nontrivial lifespan. It checks the LLApp status and, unless isRunning(), throws one of these new exceptions. Make LLCoros::toplevel() catch Stop specially and log forcible coroutine termination. Now that LLApp status matters even in a test program, introduce a trivial LLTestApp subclass whose sole function is to make isRunning() true. (LLApp::setStatus() is protected: only a subclass can call it.) Add LLTestApp instances to lleventcoro_test.cpp and lllogin_test.cpp. Make LLCoros::toplevel() accept parameters by value rather than by const reference so we can continue using them even after context switches. Make private LLCoros::get_CoroData() static. Given that we've observed some coroutines living past LLCoros destruction, making the caller call LLCoros::instance() is more dangerous than encapsulating it within a static method -- since the encapsulated call can check LLCoros::wasDeleted() first and do something reasonable instead. This also eliminates the need for both a const and non-const overload. Defend LLCoros::delete_CoroData() (cleanup function for fiber_specific_ptr for CoroData, implicitly called after coroutine termination) against calls after ~LLCoros(). Add a status string to coroutine-local data, with LLCoro::setStatus(), getStatus() and RAII class TempStatus. Add an optional 'when' string argument to LLCoros::printActiveCoroutines(). Make ~LLCoros() print the coroutines still active at destruction.
2020-03-25SL-1968: Extend lllogin_test login-failed cases for new sync timing.Nat Goodspeed
On login failure, LLLogin now tries to sync up with SLVersionChecker. It waits for up to 10 seconds before shrugging and giving up. Since that coroutine can now block for that long, make the llogin_test failure cases wait at least that long too.
2020-03-25SL-793: Fix lllogin_test.cpp for new LLCoros implementation.Nat Goodspeed
Delete the test for SRV timeout: lllogin no longer issues an SRV query. That test only confuses the test program without exercising any useful paths in production code. As with other tests dating from the previous LLCoros implementation, we need a few llcoro::suspend() calls sprinkled in so that a fiber marked ready -- by fulfilling the future for which it is waiting -- gets a chance to run. Clear LLEventPumps between test functions.
2020-03-25SL-793: Use Boost.Fiber instead of the "dcoroutine" library.Nat Goodspeed
Longtime fans will remember that the "dcoroutine" library is a Google Summer of Code project by Giovanni P. Deretta. He originally called it "Boost.Coroutine," and we originally added it to our 3p-boost autobuild package as such. But when the official Boost.Coroutine library came along (with a very different API), and we still needed the API of the GSoC project, we renamed the unofficial one "dcoroutine" to allow coexistence. The "dcoroutine" library had an internal low-level API more or less analogous to Boost.Context. We later introduced an implementation of that internal API based on Boost.Context, a step towards eliminating the GSoC code in favor of official, supported Boost code. However, recent versions of Boost.Context no longer support the API on which we built the shim for "dcoroutine." We started down the path of reimplementing that shim using the current Boost.Context API -- then realized that it's time to bite the bullet and replace the "dcoroutine" API with the Boost.Fiber API, which we've been itching to do for literally years now. Naturally, most of the heavy lifting is in llcoros.{h,cpp} and lleventcoro.{h,cpp} -- which is good: the LLCoros layer abstracts away most of the differences between "dcoroutine" and Boost.Fiber. The one feature Boost.Fiber does not provide is the ability to forcibly terminate some other fiber. Accordingly, disable LLCoros::kill() and LLCoprocedureManager::shutdown(). The only known shutdown() call was in LLCoprocedurePool's destructor. We also took the opportunity to remove postAndSuspend2() and its associated machinery: FutureListener2, LLErrorEvent, errorException(), errorLog(), LLCoroEventPumps. All that dual-LLEventPump stuff was introduced at a time when the Responder pattern was king, and we assumed we'd want to listen on one LLEventPump with the success handler and on another with the error handler. We have never actually used that in practice. Remove associated tests, of course. There is one other semantic difference that necessitates patching a number of tests: with "dcoroutine," fulfilling a future IMMEDIATELY resumes the waiting coroutine. With Boost.Fiber, fulfilling a future merely marks the fiber as ready to resume next time the scheduler gets around to it. To observe the test side effects, we've inserted a number of llcoro::suspend() calls -- also in the main loop. For a long time we retained a single unit test exercising the raw "dcoroutine" API. Remove that. Eliminate llcoro_get_id.{h,cpp}, which provided llcoro::get_id(), which was a hack to emulate fiber-local variables. Since Boost.Fiber has an actual API for that, remove the hack. In fact, use (new alias) LLCoros::local_ptr for LLSingleton's dependency tracking in place of llcoro::get_id(). In CMake land, replace BOOST_COROUTINE_LIBRARY with BOOST_FIBER_LIBRARY. We don't actually use the Boost.Coroutine for anything (though there exist plausible use cases).
2016-04-04merge with 4.0.3-releaseOz Linden
2015-11-10remove execute permission from many files that should not have itOz Linden
2015-09-21MAINT-5629: Remove llares and llareslistener. Login now does not attempt to ↵Rider Linden
do a lookup on the server names and rewrite the URL. MAINT-5614: Bad password status correctly detected.
2013-03-29Update Mac and Windows breakpad builds to latestGraham Madarasz
2010-09-03Post-convert merge by convert_monolith.py from ↵Aimee Linden
/Users/Aimee/Documents/Work/Linden-Lab/Development/viewer/convert/viewer-identity-evolution
2010-08-25standardizing a couple of stragler test 'suite' names as class nameAaron Terrell (Enus)
2010-08-13Change license from GPL to LGPL (version 2.1)Oz Linden
2010-08-12Change license on lllogin_test.cpp to allow it to be exported.Aimee Linden
Set to viewergpl for now.
2010-01-12EXT-4193: Use different reply pumps for SRV and XMLRPC requests.Nat Goodspeed
This eliminates the timing hole (introduced by EXT-3934 fix) in which a belated SRV response could confuse the XMLRPC response code. Extend unit tests to positively drive the bug and validate the fix.
2010-01-06EXT-3934: On SRV timeout, don't fail, proceed with original URI.Nat Goodspeed
2009-12-17EXT-3536 Bugfix in lllogin.cpp when reading 'indeterminate' repsonse from ↵Mark Palange (Mani)
login.cgi. Also fixed up lllogin unit test to match the bugfix. Reviewed by Brad
2009-12-04DEV-43463: use fixed Boost package on WindowsNat Goodspeed
2009-12-04DEV-43463: skip() instead of commenting out lllogin_testsNat Goodspeed
2009-12-03Fix to windows build breakages.Mark Palange (Mani)
Reviewed by Brad
2009-11-30DEV-43463: Keep LLEventPump's LLStandardSignal alive during post()Nat Goodspeed
Replace LLEventPump's boost::scoped_ptr<LLStandardSignal> with boost::shared_ptr. Take a local stack copy of that shared_ptr in post() methods, and invoke the signal through that copy. This guards against scenario in which LLEventPump gets destroyed during signal invocation. (See Jira for details.) Re-enable Mani's test case that used to crash. Introduce ll_template_cast<> to allow a template function to recognize a parameter of a particular type. Introduce LLListenerWrapper mechanism to support wrapper objects for LLEventPump listeners. You instantiate an LLListenerWrapper subclass object inline in the listen() call (typically with llwrap<>), passing it the real listener, trusting it to forward the eventual call. Introduce prototypical LLCoutListener and LLLogListener subclasses for illustrative and diagnostic purposes. Test that LLLogListener doesn't block recognizing LLEventTrackable base class bound into wrapped listener.
2009-11-12Temporary build un breakage - removing broken unit test from build while fixing.Mark Palange (Mani)
2009-11-12DEV-42715 Fixed lllogin SRV request timeout unit test.Mark Palange (Mani)
Also made SRV config options not persistent. reviewed by brad
2009-11-11Changes to fix an LLERRS caused by SRV request timeout.Mark Palange (Mani)
Added settings to config SRV request params Increased timeout to 10 seconds Changed timeout to generate login failure event instead of an error. Added unit test to cover SRV failure event.
2009-10-09DEV-40930: Added ["change"] key to login-module status events. ChangedNat Goodspeed
existing event calls to use state as "offline" or "online", with "change" indicating the reason for this status event. Changed disconnect() to send state "offline", change "disconnect" -- instead of replaying last auth failure. Changed unit tests accordingly. Changed LLLoginInstance::handleLoginEvent() to use LLEventDispatcher to route calls to handleLoginFailure() et al. Added LLEventDispatcher::get() to allow retrieving Callable by name and testing for empty().
2009-09-25DEV-32777, QAR-1619: Disable MSVC Release-build optimization for ↵Nat Goodspeed
LLCoros::launchImpl(). This fixes the Release-build crash in lllogin_test.cpp.
2009-06-17DEV-32777: tip won't even build on Windows without pacifying MSVC warningNat Goodspeed
2009-05-28DEV-32777: ensure that stack objects listening on persistent LLEventPumps getNat Goodspeed
properly disconnected when destroyed. Break out Debug class and associated macros from lleventcoro_test.cpp into test/debug.h. Add Debug output to lllogin_test.
2009-05-11svn merge -r113003:119136 ↵Nat Goodspeed
svn+ssh://svn.lindenlab.com/svn/linden/branches/login-api/login-api-2 svn+ssh://svn.lindenlab.com/svn/linden/branches/login-api/login-api-3