Tonis Tiigi
1579c97dac
test: stabilize nested progress assertions
...
Progress reads collapse unread updates by ID, so the raw item count can vary
with scheduling. Assert the final status for each nested writer instead.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2026-06-08 17:01:10 -07:00
Tonis Tiigi
c6a1dcd6b5
lint: correcting errorlint and some err113 cases
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2025-05-02 12:19:22 -07:00
Tonis Tiigi
b5286f8dcb
apply x/tools/modernize fixes
...
Autogenerated with couple of manual patches.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2025-03-07 08:18:45 -08:00
Tonis Tiigi
fc936ae3d7
lint: more testifylint fixes
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2024-06-10 21:16:51 -07:00
Tonis Tiigi
03c7a6d769
lint: fix some testifylint warnings
...
This does not cover all warning yet but split
into chunks to ease review.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2024-05-30 11:32:55 -07:00
Tonis Tiigi
8a2a3e83ec
replace context.WithCancel with WithCancelCause
...
Keep stack traces for cancellation errors where possible.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2023-12-06 22:15:06 -08:00
Tibor Vass
d59eee2985
util/progress: silence go test -race
...
Without this commit, `go test -race ./util/progress` sees a race due to the
shadowed `ctx` variable.
```
==================
WARNING: DATA RACE
Read at 0x00c000206040 by goroutine 25:
github.com/moby/buildkit/util/progress.TestProgress.func1()
github.com/moby/buildkit/util/progress/progress_test.go:25 +0x44
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x6c
Previous write at 0x00c000206040 by goroutine 6:
github.com/moby/buildkit/util/progress.TestProgress()
github.com/moby/buildkit/util/progress/progress_test.go:28 +0x4a0
testing.tRunner()
testing/testing.go:1576 +0x188
testing.(*T).Run.func1()
testing/testing.go:1629 +0x40
Goroutine 25 (running) created at:
golang.org/x/sync/errgroup.(*Group).Go()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0x10c
github.com/moby/buildkit/util/progress.TestProgress()
github.com/moby/buildkit/util/progress/progress_test.go:24 +0x360
testing.tRunner()
testing/testing.go:1576 +0x188
testing.(*T).Run.func1()
testing/testing.go:1629 +0x40
Goroutine 6 (running) created at:
testing.(*T).Run()
testing/testing.go:1629 +0x5e4
testing.runTests.func1()
testing/testing.go:2036 +0x80
testing.tRunner()
testing/testing.go:1576 +0x188
testing.runTests()
testing/testing.go:2034 +0x700
testing.(*M).Run()
testing/testing.go:1906 +0x950
main.main()
_testmain.go:49 +0x300
==================
==================
WARNING: DATA RACE
Read at 0x00c000202390 by goroutine 26:
context.(*valueCtx).Done()
<autogenerated>:1 +0x34
github.com/moby/buildkit/util/progress.(*progressReader).Read.func1()
github.com/moby/buildkit/util/progress/progress.go:126 +0xac
Previous write at 0x00c000202390 by goroutine 6:
context.WithValue()
context/context.go:593 +0xac
github.com/moby/buildkit/util/progress.FromContext.func1()
github.com/moby/buildkit/util/progress/progress.go:42 +0x168
github.com/moby/buildkit/util/progress.NewFromContext()
github.com/moby/buildkit/util/progress/progress.go:51 +0x60
github.com/moby/buildkit/util/progress.TestProgress()
github.com/moby/buildkit/util/progress/progress_test.go:28 +0x488
testing.tRunner()
testing/testing.go:1576 +0x188
testing.(*T).Run.func1()
testing/testing.go:1629 +0x40
Goroutine 26 (running) created at:
github.com/moby/buildkit/util/progress.(*progressReader).Read()
github.com/moby/buildkit/util/progress/progress.go:120 +0x15c
github.com/moby/buildkit/util/progress.saveProgress()
github.com/moby/buildkit/util/progress/progress_test.go:125 +0x48
github.com/moby/buildkit/util/progress.TestProgress.func1()
github.com/moby/buildkit/util/progress/progress_test.go:25 +0x60
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x6c
Goroutine 6 (running) created at:
testing.(*T).Run()
testing/testing.go:1629 +0x5e4
testing.runTests.func1()
testing/testing.go:2036 +0x80
testing.tRunner()
testing/testing.go:1576 +0x188
testing.runTests()
testing/testing.go:2034 +0x700
testing.(*M).Run()
testing/testing.go:1906 +0x950
main.main()
_testmain.go:49 +0x300
==================
--- FAIL: TestProgressNested (0.07s)
testing.go:1446: race detected during execution of test
--- FAIL: TestProgress (0.10s)
testing.go:1446: race detected during execution of test
FAIL
FAIL github.com/moby/buildkit/util/progress 0.112s
FAIL
```
Signed-off-by: Tibor Vass <teabee89@gmail.com >
2023-08-25 10:16:00 -07:00
Cory Bennett
b1d441b175
[ #2112 ] progress.FromContext returns a writer factory
...
this allows progress.Controller to manage the writer lifecycle
Signed-off-by: Cory Bennett <cbennett@netflix.com >
2021-06-28 18:58:29 +00:00
Tonis Tiigi
e4f6a5e752
set more tests to parallel
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2017-12-08 18:19:08 -08:00
Tonis Tiigi
4ed7fa3280
progress: refactor progress IDs to items
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2017-06-19 14:32:50 -07:00
Tonis Tiigi
13f3a45b1d
progress: refactor multireader and add status display
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2017-06-16 16:10:42 -07:00
Tonis Tiigi
62b7d04d01
control: base of status reporting
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2017-06-13 22:52:59 -07:00
Akihiro Suda
38d807bd23
fix go vet failures
...
cache/refs.go:110::error: unreachable code (vet)
util/progress/progress.go:119::error: unreachable code (vet)
util/progress/progress_test.go:130::error: unreachable code (vet)
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp >
2017-06-13 08:32:30 +00:00
Tonis Tiigi
908ead6963
util: Add nested progress test
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2017-05-31 10:05:47 -07:00
Tonis Tiigi
46339fb6fd
util: progress reporting facility
...
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com >
2017-05-30 17:45:58 -07:00