Bug#849363: libtime-format-perl: t/time.t race condition

Niko Tyni ntyni at debian.org
Mon Dec 26 09:10:05 UTC 2016


Package: libtime-format-perl
Version: 1.12-3
User: debian-perl at lists.debian.org
Usertags: autopkgtest

This package failed its test suite on ci.debian.net.

  not ok 78 - current time
  
  #   Failed test 'current time'
  #   at t/time.t line 124.
  #          got: 'Sun Dec 25 22:30:08 2016'
  #     expected: 'Sun Dec 25 22:30:07 2016'
  # Looks like you failed 1 test of 78.
  Dubious, test returned 1 (wstat 256, 0x100)
  Failed 1/78 subtests 

This is clearly a race in the test. I see this comment:

    # Note that there are two race conditions in the last section, above.
    # 1: The day or month could change between the first localtime()
    #         call and the second.
    # 2: The time (especially the seconds) could change between the
    #         %time call and the second localtime().
    # The first is extremely rare; the second more frequent.

    # Re-run the test suite if there is any doubt.

Not sure why it can't just call time() once and pass that to
the formatters. But maybe that would reduce the test coverage.
-- 
Niko Tyni   ntyni at debian.org



More information about the pkg-perl-maintainers mailing list