Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[builder] TestGenerateAndCompileDefault ant TestSkipGenerate are failing on Windows #5403

Closed
dmitryax opened this issue May 20, 2022 · 4 comments
Labels
bug Something isn't working os:windows Windows specific issues

Comments

@dmitryax
Copy link
Member

=== RUN   TestGenerateAndCompileDefault
2022-05-20T00:28:04.056Z	INFO	builder/config.go:99	Using go	{"go-executable": "C:\\hostedtoolcache\\windows\\go\\1.18.2\\x64\\bin\\go.exe"}
2022-05-20T00:28:04.056Z	INFO	builder/main.go:52	You're building a distribution with non-aligned version of the builder. Compilation may fail due to API changes. Please upgrade your builder or API	{"builder-version": "0.51.0"}
2022-05-20T00:28:04.095Z	INFO	builder/main.go:76	Sources created	{"path": "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\default1503028659"}
2022-05-20T00:28:43.056Z	INFO	builder/main.go:108	Getting go modules
2022-05-20T00:28:44.049Z	INFO	builder/main.go:87	Compiling
    main_test.go:51: 
        	Error Trace:	main_test.go:51
        	Error:      	Received unexpected error:
Error:         	            	failed to compile the OpenTelemetry Collector distribution: exit status 2. Output: "# go.opentelemetry.io/collector/cmd/builder\n.\\main_windows.go:45:32: undefined: service.NewSvcHandler\n"
        	Test:       	TestGenerateAndCompileDefault
--- FAIL: TestGenerateAndCompileDefault (77.82s)

See https://github.com/open-telemetry/opentelemetry-collector/runs/6517064706?check_suite_focus=true

@dmitryax dmitryax added the bug Something isn't working label May 20, 2022
@dmitryax dmitryax changed the title [builder] TestGenerateInvalidCollectorVersion test is failing on Windows [builder] TestGenerateAndCompileDefault test is failing on Windows May 20, 2022
bogdandrutu added a commit to bogdandrutu/opentelemetry-collector that referenced this issue Jun 3, 2022
Fixes open-telemetry#5403

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
bogdandrutu added a commit to bogdandrutu/opentelemetry-collector that referenced this issue Jun 3, 2022
Fixes open-telemetry#5403

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
@kristinapathak
Copy link
Contributor

I tried running the GeneratorAndCompile unit tests on windows in #6946 and they failed:

--- FAIL: TestGenerateAndCompileDefault (91.37s)
Error:     testing.go:1097: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestGenerateAndCompileDefault3151526655\001\components.go: The process cannot access the file because it is being used by another process.
--- FAIL: TestGenerateAndCompileWithLDFlags (6.99s)
Error:     testing.go:1097: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestGenerateAndCompileWithLDFlags4178340274\001\components.go: The process cannot access the file because it is being used by another process.

@codeboten
Copy link
Contributor

Thanks @kristinapathak, re-opening the issue

@codeboten codeboten reopened this Jan 18, 2023
@mx-psi mx-psi changed the title [builder] TestGenerateAndCompileDefault test is failing on Windows [builder] TestGenerateAndCompileDefault ant TestSkipGenerate are failing on Windows Aug 9, 2023
@mx-psi
Copy link
Member

mx-psi commented Aug 9, 2023

When bumping to Go 1.20 TestSkipGenerate also fails on Windows with the same error. I think it is related to actions/runner-images/issues/712, but I haven't been able to apply the workaround documented there so far.

@mx-psi mx-psi added the os:windows Windows specific issues label Oct 16, 2023
codeboten pushed a commit that referenced this issue Feb 6, 2024
Ensure that files written by `cmd/builder` are closed right after their
content is written. This came about while investigating #5403

**Link to tracking Issue:**
#5403 

**Testing:**
Local run on Windows

**Documentation:**
N/A
@dmitryax
Copy link
Member Author

dmitryax commented Feb 6, 2024

Resolved by #9466. Thanks @pjanotti !

@dmitryax dmitryax closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working os:windows Windows specific issues
Projects
None yet
Development

No branches or pull requests

4 participants