Skip to content

Commit 9648074

Browse files
authored
Remove flaky test (#915)
1 parent 4de1ccd commit 9648074

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

backend/gtime/gtime_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ func TestParseInterval(t *testing.T) {
2222
{inp: "2w", duration: 2 * 168 * time.Hour},
2323
{inp: "1M", duration: time.Duration(daysInMonth * 24 * int(time.Hour))},
2424
{inp: "1y", duration: time.Duration(daysInYear * 24 * int(time.Hour))},
25-
{inp: "5y", duration: time.Duration(calculateDays5y() * 24 * int(time.Hour))},
2625
{inp: "invalid-duration", err: regexp.MustCompile(`^time: invalid duration "?invalid-duration"?$`)},
2726
}
2827
for i, tc := range tcs {
@@ -85,22 +84,6 @@ func calculateDays() (int, int) {
8584
return daysInMonth, daysInYear
8685
}
8786

88-
func calculateDays5y() int {
89-
now := time.Now().UTC()
90-
currentYear, currentMonth, currentDay := now.Date()
91-
92-
var daysInYear int
93-
94-
for i := 0; i < 5; i++ {
95-
t1 := time.Date(currentYear+i, currentMonth, currentDay, 0, 0, 0, 0, time.UTC)
96-
t2 := t1.AddDate(1, 0, 0)
97-
98-
daysInYear += int(t2.Sub(t1).Hours() / 24)
99-
}
100-
101-
return daysInYear
102-
}
103-
10487
func TestFormatInterval(t *testing.T) {
10588
testCases := []struct {
10689
name string

0 commit comments

Comments
 (0)