Skip to content

Commit cadf160

Browse files
committed
internal/upload: generate local report for obsolete count files
The existing code silently removed count files that were too old to use. Now it generates a local report. It still does not generate an upload report. Fixes: golang/go#62619 Change-Id: Ic1a68e323626e2defd233316769d3ab89933d66f Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/528296 Run-TryBot: Peter Weinberger <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 6626a0d commit cadf160

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/upload/dates_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ func TestDates(t *testing.T) {
5454
date: "2020-01-01",
5555
begins: "2020-01-01",
5656
ends: olderThan(t, today, distantPast, "oldcountfile"),
57-
// locals, readys, uploads are empty, and there should be nothing left
57+
// one local; readys, uploads are empty, and there should be nothing left
58+
wantLocal: 1,
5859
},
5960
{ // test that a count file expiring today is left alone
6061
name: "todayscountfile",
@@ -113,7 +114,6 @@ func TestDates(t *testing.T) {
113114
}
114115
used[tx.name] = tx.name
115116
used[tx.date] = tx.name
116-
log.Printf("doing %s", tx.name)
117117
doTest(t, &tx, cs)
118118
}
119119
}

internal/upload/reports.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ func reports(todo *work) ([]string, error) {
4343
}
4444
}
4545
for k, v := range countFiles {
46-
if notNeeded(k, *todo) || tooOld(k) {
47-
// Too old, or the report already exists.
46+
if notNeeded(k, *todo) {
47+
// The report already exists.
4848
// There's another check in createReport.
4949
deleteFiles(v)
5050
continue

0 commit comments

Comments
 (0)