[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #26105 [Core Tor/Tor]: Perhaps, make test coverage deterministic _within_ lines
#26105: Perhaps, make test coverage deterministic _within_ lines
------------------------------+------------------------------------------
Reporter: nickm | Owner: (none)
Type: defect | Status: new
Priority: Low | Milestone: Tor: unspecified
Component: Core Tor/Tor | Version:
Severity: Normal | Keywords: coverage, tests, determinism
Actual Points: | Parent ID:
Points: | Reviewer:
Sponsor: |
------------------------------+------------------------------------------
See #25907 and #26101 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.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/26105>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs