Quellcode durchsuchen

update comment

Signed-off-by: Alex Meijer <ameijer@kubecost.com>
Alex Meijer vor 3 Jahren
Ursprung
Commit
d651c91bc1
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2 1
      pkg/kubecost/window_test.go

+ 2 - 1
pkg/kubecost/window_test.go

@@ -242,7 +242,8 @@ func TestParseWindowUTC(t *testing.T) {
 
 	// this test fails periodically if execution is so fast that time.Now() during the condition
 	// check is the same as the end of the current month time computed by ParseWindowUTC
-	if !month.End().Before(time.Now().UTC().Add(time.Nanosecond * 1)) {
+	// so we add one nanosecond to sure time.Now() is later than when invoked earlier
+	if !month.End().Before(time.Now().UTC().Add(time.Nanosecond)) {
 		t.Fatalf(`expect: window "month" to end before now; actual: %s ends after %s`, month, time.Now().UTC())
 	}