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
      Protect LLProcess destructor when run after APR shutdown. · ab7fb594
      Nat Goodspeed authored
      A static LLProcessPtr variable won't be destroyed until after procedural code
      has shut down APR. The trouble is that LLProcess's destructor unregisters
      itself from APR -- and, for an autokill LLProcess, attempts to kill the child
      process. All that is ill-advised after APR shutdown.
      Disable use of apr_pool_note_subprocess() mechanism. This should be another
      viable way of coping with static autokill LLProcessPtr variables: when the
      designated APR pool is cleaned up, APR promises to kill the child process. But
      whether it's an APR bug or a calling error, the present (now disabled) call in
      LLProcess results in OUR process, the viewer, getting SIGTERM when it asks to
      clean up the global APR pool.
      ab7fb594
    • 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 12, 2012
  4. Mar 05, 2012
    • Nat Goodspeed's avatar
      Alphabetize cmd_line.xml. · 106bac8e
      Nat Goodspeed authored
      This separate commit is just to order the keys. Data are unchanged, as
      established by:
      $ hg cat -rtip cmd_line.xml >cmd_line.xml.tip
      $ python
      Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
      [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
      Type "help", "copyright", "credits" or "license" for more information.
      >>> from llbase import llsd
      >>> tipdata = llsd.parse(open("cmd_line.xml.tip").read())
      >>> newdata = llsd.parse(open("cmd_line.xml").read())
      >>> tipdata == newdata
      True
      106bac8e
    • Nat Goodspeed's avatar
      Further reduce the block size that LLProcess writes to child pipe. · e7ceb82e
      Nat Goodspeed authored
      It seems that on Windows, even 32K is too big: one in three load-test runs
      fails with a duplicated block. Empirically, reducing it to 4K makes it much
      more stable -- at least we can run successfully 100 consecutive times, which
      is a step in the right direction.
      e7ceb82e
    • Nat Goodspeed's avatar
      Additional diagnostic code to track down strange Windows pipe error. · 2491e2bd
      Nat Goodspeed authored
      It seems that under certain circumstances, write logic was duplicating a chunk
      of the data being streamed down our pipe. But as this condition is only driven
      with a very large data stream, eyeballing that data stream is tedious. Add
      code to compare the raw received data with the expected stream, reporting
      where and how they first differ.
      2491e2bd
    • Nat Goodspeed's avatar
      Introduce (disabled) LLLeap debugging code to validate stdin writes. · 63b393da
      Nat Goodspeed authored
      While debugging mysterious problem on Windows, one potential failure mode to
      rule out was the possibility that streaming std::ostringstream <<
      LLSDNotationStreamer(large_LLSD) might itself cause trouble -- even before
      attempting to write to the LLProcess::WritePipe. The debugging code validated
      that the correct length is being reported, and that deserializing the
      resulting buffer produces equivalent LLSD. This code verified correct
      operation, and so has been disabled, as it's expensive at runtime.
      63b393da
    • Nat Goodspeed's avatar
      Make test.cpp support LOGFAIL env var: only failed tests show log. · f02ded46
      Nat Goodspeed authored
      Set LOGFAIL= one of ALL, DEBUG, INFO, WARN, ERROR, NONE. A passing test will
      run silently, as now; but a failing test will replay log output at the
      specified level or higher.
      While at it, support LOGTEST environment variable, same values. This is like
      setting --debug (or -d), but allows specifying an arbitrary level -- and,
      unlike --debug, can be set for a TeamCity build config without modifying any
      scripts or code.
      Publish LLError::decodeLevel(std::string), previously private to llerror.cpp.
      f02ded46
    • Nat Goodspeed's avatar
      Move std::ostream << CaptureLog logic into CaptureLog::streamto(). · b3b51f01
      Nat Goodspeed authored
      That lets us reliably declare the operator<<() free function inline, which
      permits multiple translation units in the same executable to #include
      "wrapllerrs.h".
      b3b51f01
  5. 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
  6. Mar 03, 2012
  7. Mar 02, 2012
  8. Mar 01, 2012
  9. Feb 29, 2012
    • Nat Goodspeed's avatar
      When constructing a pipe to child stdin on Posix, ignore SIGPIPE. · 40dc3e0d
      Nat Goodspeed authored
      We can't count on every child process reading everything we try to write to
      it. And if the child terminates with WritePipe data still pending, unless we
      explicitly suppress it, Posix will hit us with SIGPIPE. That would terminate
      the calling process, boom. "Ignoring" it means APR gets the correct errno,
      passes it back to us, we log it, etc.
      40dc3e0d
    • Oz Linden's avatar
      increment viewer version to 3.3.1 · ca36a06d
      Oz Linden authored
      ca36a06d
    • 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
  10. Feb 28, 2012
  11. Feb 27, 2012
Loading