Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #26105

Closed (moved)
Open
Opened May 15, 2018 by Nick Mathewson@nickm🐙

Perhaps, make test coverage deterministic _within_ lines

See #25907 (moved) and #26101 (moved) for background: apparently gcov now has a feature where it can tell us that a line was reached, but not every basic block within the line was reached.

Right now, our unit tests have two cases where sometimes a line is completely covered, and sometime the line is only partially covered:

--- a/workqueue.c.gcov.tmp
+++ /workqueue.c.gcov.tmp
@@ -198,7 +198,7 @@
         1:  tor_mutex_acquire(&ent->on_pool->lock);
         1:  workqueue_priority_t prio = ent->priority;
         1:  if (ent->pending) {
-        1*:    TOR_TAILQ_REMOVE(&ent->on_pool->work[prio], ent, next_work);
+        1:    TOR_TAILQ_REMOVE(&ent->on_pool->work[prio], ent, next_work);
         1:    cancelled = 1;
         1:    result = ent->arg;
         -:  }
--- a/compat_pthreads.c.gcov.tmp
+++ /compat_pthreads.c.gcov.tmp
@@ -271,7 +271,7 @@
         -:      }
         1:      tvnow.tv_sec = ts.tv_sec;
         1:      tvnow.tv_usec = (int)(ts.tv_nsec / 1000);
-        1*:      timeradd(tv, &tvnow, &tvsum);
+        1:      timeradd(tv, &tvnow, &tvsum);
         -:#else /* !(defined(HAVE_CLOCK_GETTIME) && defined(USE_COND_CLOCK)) */
         -:      if (gettimeofday(&tvnow, NULL) < 0)
         -:        return -1;

Unless coveralls cares about these, I think solving the determinism here is not super-important, though it might be fun from a completionist perspective.

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
Tor: unspecified
Milestone
Tor: unspecified
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#26105