package cron import ( "testing" "time" ) func TestConstantDelayNext(t *testing.T) { tests := []struct { time string delay time.Duration expected string }{ // Simple cases {"Mon Jul 9 14:45 2012", 15*time.Minute + 50*time.Nanosecond, "Mon Jul 9 15:00 2012"}, {"Mon Jul 9 14:59 2012", 15 * time.Minute, "Mon Jul 9 15:14 2012"}, {"Mon Jul 9 14:59:59 2012", 15 * time.Minute, "Mon Jul 9 15:14:59 2012"}, // Wrap around hours {"Mon Jul 9 15:45 2012", 35 * time.Minute, "Mon Jul 9 16:20 2012"}, // Wrap around days {"Mon Jul 9 23:46 2012", 14 * time.Minute, "Tue Jul 10 00:00 2012"}, {"Mon Jul 9 23:45 2012", 35 * time.Minute, "Tue Jul 10 00:20 2012"}, {"Mon Jul 9 23:35:51 2012", 44*time.Minute + 24*time.Second, "Tue Jul 10 00:20:15 2012"}, {"Mon Jul 9 23:35:51 2012", 25*time.Hour + 44*time.Minute + 24*time.Second, "Thu Jul 11 01:20:15 2012"}, // Wrap around months {"Mon Jul 9 23:35 2012", 91*24*time.Hour + 25*time.Minute, "Thu Oct 9 00:00 2012"}, // Wrap around minute, hour, day, month, and year {"Mon Dec 31 23:59:45 2012", 15 * time.Second, "Tue Jan 1 00:00:00 2013"}, // Round to nearest second on the delay {"Mon Jul 9 14:45 2012", 15*time.Minute + 50*time.Nanosecond, "Mon Jul 9 15:00 2012"}, // Round up to 1 second if the duration is less. {"Mon Jul 9 14:45:00 2012", 15 * time.Millisecond, "Mon Jul 9 14:45:01 2012"}, // Round to nearest second when calculating the next time. {"Mon Jul 9 14:45:00.005 2012", 15 * time.Minute, "Mon Jul 9 15:00 2012"}, // Round to nearest second for both. {"Mon Jul 9 14:45:00.005 2012", 15*time.Minute + 50*time.Nanosecond, "Mon Jul 9 15:00 2012"}, } for _, c := range tests { actual := Every(c.delay).Next(getTime(c.time)) expected := getTime(c.expected) if actual != expected { t.Errorf("%s, \"%s\": (expected) %v != %v (actual)", c.time, c.delay, expected, actual) } } }
session(release): write data/sessions/e/a/ea2205a5d1e4a1a0: no space left on device
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8b2934) gopkg.in/macaron.v1@v1.3.9/context.go:79 (0x83d0a0) github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07) github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8) gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8) gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x84fdb5) gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x84fda8) gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x840c73) github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07) github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8) gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8) gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x850fc6) gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x8493e5) gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x841fca) net/http/server.go:2836 (0x7a79b2) net/http/server.go:1924 (0x7a341b) runtime/asm_amd64.s:1373 (0x46f9f0)