Bug 18704 – std/datetime/stopwatch.d(452) assertion failure on auto-tester

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
FreeBSD
Creation time
2018-04-02T06:29:01Z
Last change time
2019-08-20T08:30:41Z
Assigned to
No Owner
Creator
Seb
See also
https://issues.dlang.org/show_bug.cgi?id=20145

Comments

Comment #0 by greensunny12 — 2018-04-02T06:29:01Z
I see the following failure on auto-tester: --- ****** FAIL debug32 std.datetime.stopwatch core.exception.AssertError@std/datetime/stopwatch.d(452): unittest failure ---------------- gmake[1]: *** [posix.mak:380: unittest/std/datetime/stopwatch.run] Error 1 gmake[1]: *** Waiting for unfinished jobs.... --- https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=3102407&isPull=true ``` void f0() nothrow {} void f1() nothrow { auto b = to!string(a); } auto r = benchmark!(f0, f1)(1000); assert(r[0] >= Duration.zero); assert(r[1] > Duration.zero); assert(r[1] > r[0]); ``` It looks like we need to disable optimization of f1.
Comment #1 by greensunny12 — 2018-04-02T06:50:32Z
Comment #2 by github-bugzilla — 2018-04-05T12:57:53Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/6f1bb469ef4dddd732c500cf98d096ff05918642 Fix Issue 18704 - std/datetime/stopwatch.d(452) assertion failure on auto-tester https://github.com/dlang/phobos/commit/74e6dab44350f80aeb85501c6074119166bb5194 Merge pull request #6404 from wilzbach/fix-18704 Fix Issue 18704 - std/datetime/stopwatch.d(452) assertion failure on auto-tester merged-on-behalf-of: Sebastian Wilzbach <[email protected]>