Skip to content

No test asserts which thread the Logger is called on #23

Closed

Description

@dmccoystephenson

Summary

The "Never throws" row of the README promise table (since #22) and the Logger typedef comment in trace_client.hpp both state which thread the Logger is called on:

  • a failed delivery — on the client's own sending thread (deliver, called from drain; trace_client.hpp shared.log("could not deliver ...") and shared.log("trace server answered ..."));
  • a full queue — on the thread that called report (enqueue, shared->log("queue full, dropped " + name)).

No test in test/test_trace_client.cpp asserts either. A search for thread::id and this_thread::get_id in the test file finds nothing; the existing Logger tests (log.count("queue full"), the throwing/reporting/silent-after-close tests) check what is logged, not where.

Suggested test

A Stage B characterization test: a Logger that records std::this_thread::get_id() alongside each message, then

  • against a StubServer answering non-201, the "trace server answered" message's thread id differs from the test thread's;
  • after holding the server and flooding past QUEUE_CAPACITY, every "queue full" message's thread id equals the test thread's.

Both observations go through the stub server and the Logger, with no new sleeps.

This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions