1
0
mirror of https://github.com/golang/go synced 2024-10-04 15:11:20 -06:00
Commit Graph

24 Commits

Author SHA1 Message Date
Brad Fitzpatrick
86a8d59a01 time: make TestReset more reliable
Fixes #4690

R=golang-dev, alex.brainman, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7181052
2013-01-22 17:25:58 -08:00
Alex Brainman
e0aa26a427 time: Sleep does better job then runtime.Gosched in TestAfterStress
for slow windows-386 builder

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/7128053
2013-01-18 15:31:01 +11:00
Volker Dobler
44ff17e664 time: add Timer.Reset
Fixes #4412.

R=adg, rsc, rogpeppe, andrewdg, bradfitz
CC=golang-dev
https://golang.org/cl/7086050
2013-01-17 14:41:53 +11:00
Dmitriy Vyukov
a0efca84e6 time: fix deadlock in Sleep(0)
See time/sleep_test.go for repro.

R=golang-dev, r, rsc
CC=golang-dev, patrick.allen.higgins
https://golang.org/cl/6250072
2012-05-29 22:30:56 +04:00
Brad Fitzpatrick
8c5290502f time: skip a often-flaky test in short mode
In -test.short mode, skip measuring the upper bound of time
sleeps. The API only guarantees minimum bounds on sleeps,
anyway, so this isn't a bug we're ignoring as much as it is
simply observing bad builder virtualization and/or loaded
machines.

We keep the test in full mode where developers will
presumably be running on a lightly-loaded, native, fast
machine.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5713044
2012-02-29 13:14:05 -08:00
Rémy Oudompheng
2a6e6999a4 runtime, time: accelerate tests in short mode.
before   after
go test -short time                4.144s  1.215s
go test -short runtime             1.315s  0.351s
go test -short -cpu=1,2,4 runtime  4.376s  1.266s

Partially solves issue 3015.

R=golang-dev, r
CC=golang-dev, remy
https://golang.org/cl/5673045
2012-02-14 22:13:19 +01:00
Russ Cox
fc7b9fc269 time: allow sleep tests to run for 200% too long
Some VMs are slow.  Very slow.
Fixes #2421.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5482049
2011-12-12 18:33:47 -05:00
David Symonds
2949f3b659 time: use Duration for AfterFunc.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5465043
2011-12-08 15:42:44 +11:00
Russ Cox
efe3d35fc5 time: new Time, Duration, ZoneInfo types
R=r, bradfitz, gri, dsymonds, iant
CC=golang-dev
https://golang.org/cl/5392041
2011-11-30 11:59:44 -05:00
Dmitriy Vyukov
a899a467f2 time: fix timer stop
Due to data structure corruption,
some timers could not be removed.
Fixes #2495.

R=golang-dev, adg
CC=golang-dev, mdbrown
https://golang.org/cl/5437060
2011-11-25 14:13:10 +03:00
Dmitriy Vyukov
ba98a7ee5e time: fix test hang
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5374083
2011-11-14 22:31:39 +03:00
Dmitriy Vyukov
dc6726b37f runtime: fix timers crash
Timer callbacks occasionally crash
with "sched while holding locks" message.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5381043
2011-11-14 21:59:48 +03:00
Russ Cox
965845a86d all: sort imports
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5319072
2011-11-02 15:54:16 -04:00
Russ Cox
eb6929299b src/pkg/[n-z]*: gofix -r error -force=error
R=golang-dev, bsiegert, iant
CC=golang-dev
https://golang.org/cl/5294074
2011-11-01 22:05:34 -04:00
Russ Cox
75d337e84b time: fix zone during windows test
Factor out sleep interrupt.

Fixes #1109.

R=alex.brainman, go.peter.90, mattn.jp
CC=golang-dev
https://golang.org/cl/4968041
2011-08-26 15:15:23 -04:00
Andrew Gerrand
5bcbcab311 sort: rename helpers: s/Sort// in sort.Sort[Float64s|Ints|Strings]
Includes 'sorthelpers' gofix and updates to tree.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4631098
2011-07-08 10:52:50 +10:00
Andrew Gerrand
d54c4ecc32 time: make TestAfterQueuing retry 3 times before declaring failure.
I'm in two minds as to whether this should be a function of gotest.
Tests that can flake out like this should be rare enough that we
needn't add more mechanism.

R=r
CC=golang-dev
https://golang.org/cl/4335042
2011-03-30 11:40:00 +11:00
Russ Cox
f4e76d8309 replace non-blocking send, receive syntax with select
R=golang-dev, nigeltao, niemeyer, r
CC=golang-dev
https://golang.org/cl/4079053
2011-01-31 18:36:28 -05:00
Roger Peppe
2ae953bfc3 time: allow cancelling of After events.
Also simplify sleeper algorithm and poll
occasionally so redundant sleeper goroutines
will quit sooner.

R=r, niemeyer, r2
CC=golang-dev
https://golang.org/cl/4063043
2011-01-25 12:25:48 -08:00
Roger Peppe
212e074be2 time: add AfterFunc to call a function after a given duration.
The After code is trivially generalisable to provide support
for this, and it is possible to use AfterFunc to do
things that After cannot, such as waiting
for many events at varied times without an overhead
of one goroutine per event.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3905041
2011-01-10 11:51:38 -08:00
Russ Cox
6eee9ed507 time: fix build
Allow less precise timing on build machines.

TBR=r
CC=golang-dev
https://golang.org/cl/3391043
2010-12-06 16:22:32 -05:00
Roger Peppe
e2d1595c81 time: make After use fewer goroutines and host processes.
With credit to Gustavo Niemeyer, who hinted at this approach
in #go-nuts.

R=adg, rsc, niemeyer, r
CC=golang-dev
https://golang.org/cl/3416043
2010-12-06 14:19:30 -05:00
Andrew Gerrand
1e66a21348 time: add After
Permits one to easily put a timeout in a select:

select {
case <-ch:
	// foo
case <-time.After(1e6):
	// bar
}

R=r, rog, rsc, sameer1, PeterGo, iant, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/2321043
2010-10-11 13:45:26 +11:00
Christopher Wedgwood
1e66428d59 time: Sleep through interruptions
R=rsc
CC=golang-dev
https://golang.org/cl/202043
2010-02-04 13:09:02 -08:00