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
  • #18025

Closed (moved)
Open
Opened Jan 09, 2016 by weasel (Peter Palfrader)@weasel

test_util_touch_file is racy and *does* fail

Tor's master has a broken test:

https://jenkins.torproject.org/job/tor-debian-master-nightly-binaries/630/ARCHITECTURE=i386,SUITE=wily/console

00:30:38 util/get_avail_disk_space: OK
00:30:38 util/touch_file: 
00:30:38   FAIL ../src/test/test_util.c:4615: assert(st.st_mtime OP_GE now): 1452299437 vs 1452299438
00:30:38   [touch_file FAILED]
00:30:38 util/pwdb: [forking] OK

from test_util.c:

  const time_t now = time(NULL);
  struct stat st;
  write_bytes_to_file(fname, "abc", 3, 1);
  tt_int_op(0, OP_EQ, stat(fname, &st));
  tt_i64_op(st.st_mtime, OP_GE, now);

The test is flawed to begin with, there's no guarantee for how much or little time is between the time() call and the write().

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