buildx icon indicating copy to clipboard operation
buildx copied to clipboard

Flaky test: `TestLaunch`

Open crazy-max opened this issue 2 months ago • 2 comments

Happened when running unit tests in vagrant for openbsd platform: https://github.com/docker/buildx/actions/runs/18729739901/job/53423646001?pr=3453#step:7:1208

Just fyi to keep track of it in case it happens again on native runners.

=== RUN   TestLaunch
    adapter_test.go:111: [client] send: {"seq":1,"type":"request","command":"initialize","arguments":{"adapterID":"","linesStartAt1":false,"columnsStartAt1":false}}
    adapter_test.go:128: [server] recv: {"seq":1,"type":"request","command":"initialize","arguments":{"adapterID":"","linesStartAt1":false,"columnsStartAt1":false,"pathFormat":"path"}}
    adapter_test.go:111: [server] send: {"seq":1,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"supportsConfigurationDoneRequest":true}}
    adapter_test.go:128: [client] recv: {"seq":1,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"supportsConfigurationDoneRequest":true}}
    adapter_test.go:111: [client] send: {"seq":2,"type":"request","command":"launch","arguments":null}
    adapter_test.go:128: [server] recv: {"seq":2,"type":"request","command":"launch","arguments":null}
    adapter_test.go:111: [server] send: {"seq":2,"type":"response","request_seq":2,"success":true,"command":"launch"}
    adapter_test.go:111: [server] send: {"seq":3,"type":"event","event":"initialized"}
    adapter_test.go:128: [client] recv: {"seq":2,"type":"response","request_seq":2,"success":true,"command":"launch"}
    adapter_test.go:128: [client] recv: {"seq":3,"type":"event","event":"initialized"}
    adapter_test.go:58: 
        	Error Trace:	/vagrant/dap/adapter_test.go:58
        	            				/vagrant/vendor/golang.org/x/sync/errgroup/errgroup.go:93
        	            				/usr/local/go/src/runtime/asm_amd64.s:1693
        	Error:      	did not receive initialized event
        	Test:       	TestLaunch
    adapter_test.go:111: [client] send: {"seq":3,"type":"request","command":"configurationDone"}
    adapter_test.go:128: [server] recv: {"seq":3,"type":"request","command":"configurationDone"}
    adapter_test.go:111: [server] send: {"seq":4,"type":"response","request_seq":3,"success":true,"command":"configurationDone"}
    adapter_test.go:128: [client] recv: {"seq":4,"type":"response","request_seq":3,"success":true,"command":"configurationDone"}
    adapter_test.go:123: [server] recv error: context canceled
    adapter_test.go:123: [client] recv error: context canceled
--- FAIL: TestLaunch (0.00s)

crazy-max avatar Oct 22 '25 21:10 crazy-max

This can be reproduced quite easily by spamming -count=1000.

$ go test -count=1000 -timeout 30s -run ^TestLaunch$ github.com/docker/buildx/dap
--- FAIL: TestLaunch (10.00s)
    adapter_test.go:111: [client] send: {"seq":1,"type":"request","command":"initialize","arguments":{"adapterID":"","linesStartAt1":false,"columnsStartAt1":false}}
    adapter_test.go:128: [server] recv: {"seq":1,"type":"request","command":"initialize","arguments":{"adapterID":"","linesStartAt1":false,"columnsStartAt1":false,"pathFormat":"path"}}
    adapter_test.go:111: [server] send: {"seq":1,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"supportsConfigurationDoneRequest":true}}
    adapter_test.go:128: [client] recv: {"seq":1,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"supportsConfigurationDoneRequest":true}}
    adapter_test.go:111: [client] send: {"seq":2,"type":"request","command":"launch","arguments":null}
    adapter_test.go:128: [server] recv: {"seq":2,"type":"request","command":"launch","arguments":null}
    adapter_test.go:111: [server] send: {"seq":2,"type":"response","request_seq":2,"success":true,"command":"launch"}
    adapter_test.go:128: [client] recv: {"seq":2,"type":"response","request_seq":2,"success":true,"command":"launch"}
    adapter_test.go:58:
        	Error Trace:	.../buildx/dap/adapter_test.go:58
        	            				.../buildx/vendor/golang.org/x/sync/errgroup/errgroup.go:93
        	            				/usr/local/go/src/runtime/asm_arm64.s:1268
        	Error:      	did not receive initialized event
        	Test:       	TestLaunch
    adapter_test.go:111: [server] send: {"seq":3,"type":"event","event":"initialized"}
    adapter_test.go:128: [client] recv: {"seq":3,"type":"event","event":"initialized"}
    adapter_test.go:111: [client] send: {"seq":3,"type":"request","command":"configurationDone"}
    adapter_test.go:128: [server] recv: {"seq":3,"type":"request","command":"configurationDone"}
    adapter_test.go:111: [server] send: {"seq":4,"type":"response","request_seq":3,"success":true,"command":"configurationDone"}
    adapter_test.go:128: [client] recv: {"seq":4,"type":"response","request_seq":3,"success":true,"command":"configurationDone"}
    adapter_test.go:123: [server] recv error: context deadline exceeded
    adapter_test.go:64:
        	Error Trace:	.../buildx/dap/adapter_test.go:64
        	            				.../buildx/vendor/golang.org/x/sync/errgroup/errgroup.go:93
        	            				/usr/local/go/src/runtime/asm_arm64.s:1268
        	Error:      	did not receive configurationDone response
        	Test:       	TestLaunch
    adapter_test.go:123: [client] recv error: context canceled
panic: sync: WaitGroup is reused before previous Wait has returned

goroutine 12659 [running]:
sync.(*WaitGroup).Wait(0x14000a88f88)
	/usr/local/go/src/sync/waitgroup.go:208 +0x14c
golang.org/x/sync/errgroup.(*Group).Wait(0x14000a88f80)
	.../buildx/vendor/golang.org/x/sync/errgroup/errgroup.go:56 +0x28
github.com/docker/buildx/dap.(*Server).Serve.func4()
	.../buildx/dap/server.go:61 +0x50
golang.org/x/sync/errgroup.(*Group).Go.func1()
	.../buildx/vendor/golang.org/x/sync/errgroup/errgroup.go:93 +0x4c
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 12591
	.../buildx/vendor/golang.org/x/sync/errgroup/errgroup.go:78 +0x90
FAIL	github.com/docker/buildx/dap	10.543s
FAIL

rcjsuen avatar Oct 23 '25 08:10 rcjsuen

Got it again with openbsd in https://github.com/docker/buildx/actions/runs/19291895364/job/55164364388?pr=3462#step:7:1209

 === RUN   TestLaunch
    adapter_test.go:176: [client] send: {"seq":1,"type":"request","command":"initialize","arguments":{"adapterID":"","linesStartAt1":false,"columnsStartAt1":false}}
    adapter_test.go:193: [server] recv: {"seq":1,"type":"request","command":"initialize","arguments":{"adapterID":"","linesStartAt1":false,"columnsStartAt1":false,"pathFormat":"path"}}
    adapter_test.go:176: [server] send: {"seq":1,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"supportsConfigurationDoneRequest":true}}
    adapter_test.go:193: [client] recv: {"seq":1,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"supportsConfigurationDoneRequest":true}}
    adapter_test.go:176: [client] send: {"seq":2,"type":"request","command":"launch","arguments":null}
    adapter_test.go:193: [server] recv: {"seq":2,"type":"request","command":"launch","arguments":null}
    adapter_test.go:176: [server] send: {"seq":2,"type":"response","request_seq":2,"success":true,"command":"launch"}
    adapter_test.go:176: [server] send: {"seq":3,"type":"event","event":"initialized"}
    adapter_test.go:193: [client] recv: {"seq":2,"type":"response","request_seq":2,"success":true,"command":"launch"}
    adapter_test.go:193: [client] recv: {"seq":3,"type":"event","event":"initialized"}
    adapter_test.go:59: 
        	Error Trace:	/vagrant/dap/adapter_test.go:59
        	            				/vagrant/vendor/golang.org/x/sync/errgroup/errgroup.go:93
        	            				/usr/local/go/src/runtime/asm_amd64.s:1693
        	Error:      	did not receive initialized event
        	Test:       	TestLaunch
    adapter_test.go:176: [client] send: {"seq":3,"type":"request","command":"configurationDone"}
    adapter_test.go:193: [server] recv: {"seq":3,"type":"request","command":"configurationDone"}
    adapter_test.go:176: [server] send: {"seq":4,"type":"response","request_seq":3,"success":true,"command":"configurationDone"}
    adapter_test.go:193: [client] recv: {"seq":4,"type":"response","request_seq":3,"success":true,"command":"configurationDone"}
    adapter_test.go:188: [server] recv error: context canceled
    adapter_test.go:188: [client] recv error: context canceled
--- FAIL: TestLaunch (0.00s)

crazy-max avatar Nov 12 '25 09:11 crazy-max