Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #26008
Closed (moved) (moved)
Open
Issue created May 02, 2018 by Nick Mathewson@nickm🤹

Make workqueue cancel code always get covered by tests.

After re-running the tests many times with the other #25908 (moved) children fixed, I found a remaining variance from the most usual test coverage. This case happened only once out of ~450 runs:

--- coverage-1525271181/workqueue.c.gcov.tmp	2018-05-02 15:59:24.758433136 -0400
+++ coverage-1525271827/workqueue.c.gcov.tmp	2018-05-02 15:59:24.760433142 -0400
@@ -198,14 +198,14 @@
         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:    cancelled = 1;
-        1:    result = ent->arg;
+    #####:    TOR_TAILQ_REMOVE(&ent->on_pool->work[prio], ent, next_work);
+    #####:    cancelled = 1;
+    #####:    result = ent->arg;
         -:  }
         1:  tor_mutex_release(&ent->on_pool->lock);
         -:
         1:  if (cancelled) {
-        1:    workqueue_entry_free(ent);
+    #####:    workqueue_entry_free(ent);
         -:  }
         1:  return result;
         -:}
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking