Uploaded image for project: 'HTrace'
  1. HTrace
  2. HTRACE-301

htraced: fix unit tests that aren't waiting for spans to be written, use semaphore for WrittenSpans

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 4.1
    • htraced
    • None

    Description

      We have a few unit tests that aren't waiting for spans to be written, but which should. For example, TestClientOperations intermittently fails due to missing spans. According to the test log, FindSpan was called before the span is written to datastore.

      This patch replaces WriteSpans with a semaphore. The reasoning is that it is sometimes difficult to debug unit tets where the datastore is blocked sending to the WriteSpans debug channel because the test has become blocked or is exiting. Buffered channels could eliminate this problem, but for certain tests, the buffers would have to be extremely large. Using a semaphore eliminates this problem. Semaphores will also be more efficient when we start ingesting spans in batches (see HTRACE-298) since we can increment the semaphore once rather than sending multiple spans on the WriteSpans channel. This is important for getting realistic benchmarks.

      Attachments

        1. HTRACE-301.001.patch
          20 kB
          Colin McCabe
        2. HTRACE-301.002.patch
          21 kB
          Colin McCabe

        Issue Links

          Activity

            People

              cmccabe Colin McCabe
              iwasakims Masatake Iwasaki
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: