Skip to content
Snippets Groups Projects
  1. Mar 14, 2012
  2. Mar 13, 2012
    • Nat Goodspeed's avatar
      If very-large-message test fails, search for a size that works. · bdc27815
      Nat Goodspeed authored
      We want to write a robust test that consistently works. On Windows, that
      appears to require constraining the max message size. I, the coder, could try
      submitting test runs of varying sizes to TC until I found a size that works...
      but that could take quite a while. If I were clever, I might even use a manual
      binary search. But computers are good at binary searching; there are even
      prepackaged algorithms in the STL. If I were cleverer still, I could make the
      test program itself search for size that works.
      bdc27815
    • Nat Goodspeed's avatar
      Increase timeout for very-large-message test. · 1bdc876b
      Nat Goodspeed authored
      Apparently, at least on Mac, there are circumstances in which the very-large-
      message test can take several times longer than normal, yet still complete
      successfully. This is always the problem with timeouts: does timeout
      expiration mean that the code in question is actually hung, or would it
      complete if given a bit longer?
      If very-large-message test fails, retry a few times with smaller sizes to try
      to find a size at which the test runs reliably. The default size, ca 1MB, is
      intended to be substantially larger than anything we'll encounter in the wild.
      Is that "unreasonably" large? Is there a "reasonable" size at which the test
      could consistently pass? Is that "reasonable" size still larger than what we
      expect to encounter in practice? Need more information, hence this code.
      1bdc876b
    • Nat Goodspeed's avatar
      Add timeout functionality to waitfor() helper functions. · 7d3cf544
      Nat Goodspeed authored
      Otherwise, a stuck child process could potentially hang the test, and thus the
      whole viewer build.
      7d3cf544
  3. Mar 05, 2012
  4. Mar 04, 2012
    • Nat Goodspeed's avatar
      Simplify llleap_test.cpp plugin by reading individual characters. · 30e8e23d
      Nat Goodspeed authored
      While we're accumulating the 'length:' prefix, the present socket-based logic
      reads 20 characters, then reads 'length' more, then discards any excess (in
      case the whole 'length:data' packet ends up being less than 20 characters).
      That's probably a bug: whatever characters follow that packet, however short
      it may be, are probably the 'length:' prefix of the next packet. We probably
      only get away with it because we probably never send packets that short.
      Earlier llleap_test.cpp plugin logic still read 20 characters, then, if there
      were any left after the present packet, cached them as the start of the next
      packet. This is probably more correct, but complicated. Easier just to read
      individual characters until we've seen 'length:', then try for exactly the
      specified length over however many reads that requires.
      30e8e23d
    • Nat Goodspeed's avatar
      Make llleap_test.cpp avoid hard limit on MSVC std::ostringstream max. · ca703b2b
      Nat Goodspeed authored
      In load testing, we have observed intermittent failures on Windows in which
      LLSDNotationStreamer into std::ostringstream seems to bump into a hard limit
      of 1048590 bytes. ostringstream reports that much buffered data and returns
      that much -- even though, on examination, the notation-serialized stream is
      incomplete at that point. It's our intention to load-test LLLeap and
      LLProcess, not the local iostream implementation; we hope that this kind of
      data volume is comfortably greater than actual usage. Back off the
      load-testing max size a bit.
      ca703b2b
  5. Mar 03, 2012
    • Nat Goodspeed's avatar
      Add debugging output in case LLLeap writes corrupt data to plugin. · d72d9f73
      Nat Goodspeed authored
      New llleap_test.cpp load testing turned up Windows issue in which plugin
      process received corrupt packet, producing LLSDParseError. Add code to dump
      the bad packet in that case -- but if LLSDParseError is willing to state the
      offset of the problem, not ALL of the packet.
      Quiet MSVC warning about little internal base class needing virtual destructor.
      d72d9f73
  6. Mar 02, 2012
  7. Mar 01, 2012
  8. Feb 29, 2012
    • Nat Goodspeed's avatar
      Guarantee LLProcess::Params::postend listener any ReadPipe data. · 3649eda6
      Nat Goodspeed authored
      Previously one might get process-terminated notification but still have to
      wait for the child process's final data to arrive on one or more ReadPipes.
      That required complex consumer timing logic to handle incomplete pending
      ReadPipe data, e.g. a partial last line with no terminating newline. New code
      guarantees that by the time LLProcess sends process-terminated notification,
      all pending pipe data will have been buffered in ReadPipes.
      Document LLProcess::ReadPipe::getPump() notification event; add "eof" key.
      Add LLProcess::ReadPipe::getline() and read() convenience methods.
      Add static LLProcess::getline() and basename() convenience methods, publishing
      logic already present elsewhere.
      Use ReadPipe::getline() and read() in unit tests.
      Add unit test for "eof" event on ReadPipe::getPump().
      Add unit test verifying that final data have been buffered by termination
      notification event.
      3649eda6
  9. Feb 27, 2012
  10. Feb 26, 2012
  11. Feb 24, 2012
    • Nat Goodspeed's avatar
      Get rid of indra/llcommon/tests/setpython.py. · d2faf5d2
      Nat Goodspeed authored
      run_build_test.py already has the capability to set environment variables, and
      we may as well direct it to set PYTHON to the running Python interpreter. That
      completely eliminates one level of process wrapper.
      d2faf5d2
    • Nat Goodspeed's avatar
      Add LLStringUtil::getTokens() overload handling quoted substrings. · 025329b6
      Nat Goodspeed authored
      We didn't have any tokenizer suitable for scanning something like a bash
      command line. We do have a couple hacks, e.g. LLExternalEditor::tokenize() and
      LLCommandLineParser::parseCommandLineString(). Both try to work around
      boost::tokenizer limitations; but existing boost::tokenizer support just
      doesn't address this case. Neither of the above is available as a general
      scanner anyway, and parseCommandLineString() fails outright when passed "".
      New getTokens() also distinguishes between "drop delimiters" (e.g. space,
      return, newline) to be discarded from the token stream, versus "keep
      delimiters" (e.g. "+-*/") to be returned as tokens in their own right.
      There's an overload that honors escapes and a more efficient one that doesn't;
      each has a convenience overload that returns the scanned string vector rather
      than requiring a separate declaration.
      Tweak and comment older getTokens() implementation.
      Add unit tests for both old and new getTokens() implementations.
      Break out StringVec and std::ostream << StringVec from
      indra/llcommon/tests/listener.h to StringVec.h: that's coming in handy for a
      number of different TUT test sources.
      025329b6
  12. Feb 23, 2012
    • Nat Goodspeed's avatar
      Tighten up LLProcess pipe support, per Richard's code review. · 14ddc647
      Nat Goodspeed authored
      Clarify wording in some of the doc comments; be a bit more explicit about some
      of the parameter fields.
      Make some query methods 'const'.
      Change default LLProcess::ReadPipe::getLimit() value to 0: don't post any
      incoming data with notification event unless caller requests it. But do post
      pertinent FILESLOT in case caller reuses same listener for both stdout and
      stderr.
      Use more idiomatic, readable syntax for accessing LLProcess::Params data.
      14ddc647
  13. Feb 20, 2012
    • Nat Goodspeed's avatar
      Let LLProcess consumer specify desired description for logging. · 999484a6
      Nat Goodspeed authored
      If caller runs (e.g.) a Python script, it's not very helpful to a human log
      reader to keep seeing LLProcess instances logged as /pathname/to/python (pid).
      If caller is aware, the code can at least use the script name as the desc --
      or maybe even a hint as to the script's purpose.
      If caller doesn't explicitly pass a desc, at least shorten to just the
      basename of the executable.
      999484a6
    • Nat Goodspeed's avatar
      Make LLProcess post termination event to specified pump if desired. · 8b5d5f96
      Nat Goodspeed authored
      This way a caller need not spin on isRunning(); we can just listen for the
      requested termination event.
      Post a similar event containing error message if for any reason
      LLProcess::create() failed to launch the child.
      Add unit tests for both cases.
      8b5d5f96
  14. Feb 16, 2012
    • Nat Goodspeed's avatar
      Fix typos in a few LLProcess::ReadPipe::find() unit tests. · f52cf4be
      Nat Goodspeed authored
      The typos didn't make for invalid tests, but they made a few tests redundant
      while leaving other (subtly different) cases untested.
      f52cf4be
    • Nat Goodspeed's avatar
      Fix bug in LLProcess::ReadPipe::peek() substring computation. · a06ba836
      Nat Goodspeed authored
      Add unit tests for peek() with substring args, reimplemented contains(),
      various forms of find().
      (yay unit tests)
      a06ba836
    • Nat Goodspeed's avatar
      4ecf9d6a
    • Nat Goodspeed's avatar
      Add LLProcess::ReadPipe::find() methods, with corresponding npos. · e92c3113
      Nat Goodspeed authored
      If it's useful to have contains() to tell you whether incoming data contains a
      particular substring, and if it's useful for contains() and peek() to accept
      an offset within that data, then it's useful to allow you to get the offset of
      a desired substring within that data. But of course a find() returning offset
      needs something like std::string::npos for "not found"; borrow that
      convention.
      Support both find(const std::string&) and find(char); the latter permits a
      more efficient implementation. In fact, make find(string) recognize a string
      of length 1 and leverage the find(char) implementation.
      Given that, reimplement contains(mumble) as shorthand for find(mumble) != npos.
      Implement find() overloads using std::search() and std::find() on
      boost::asio::streambuf character iterators, rather than copying to std::string
      and then using string search like previous contains() implementation.
      Reimplement WritePipeImpl::tick() and ReadPipeImpl::tick() to write/read
      directly from/to boost::asio::streambuf data, instead of copying to/from a
      temporary flat buffer.
      As long as ReadPipeImpl::tick() keeps successfully filling buffers, keep
      reading. Previous implementation would only handle a long child write over
      successive tick() calls. Stop on read error or when we come up short.
      e92c3113
  15. Feb 15, 2012
Loading