Perhaps, make test coverage deterministic _within_ lines
See legacy/trac#25907 (moved) and legacy/trac#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.