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

[pkg/stanza/fileconsumer] TestExcludeOlderThanFilter/file_not_present test failing on Windows #32464

Closed
crobert-1 opened this issue Apr 16, 2024 · 3 comments · Fixed by #32474
Labels

Comments

@crobert-1
Copy link
Member

Component(s)

pkg/stanza

Describe the issue you're reporting

Failed CI/CD run

Failure output:

=== Failed
=== FAIL: fileconsumer/matcher/internal/filter TestExcludeOlderThanFilter/file_not_present (0.00s)
    exclude_test.go:95: 
        	Error Trace:	D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/matcher/internal/filter/exclude_test.go:95
        	Error:      	Error "CreateFile C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\TestExcludeOlderThanFilterfile_not_present318488423\\001\\b.log: The system cannot find the file specified." does not contain "b.log: no such file or directory"
        	Test:       	TestExcludeOlderThanFilter/file_not_present

=== FAIL: fileconsumer/matcher/internal/filter TestExcludeOlderThanFilter (0.02s)

=== FAIL: fileconsumer/matcher/internal/filter TestExcludeOlderThanFilter/file_not_present (re-run 1) (0.00s)
    exclude_test.go:95: 
        	Error Trace:	D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/matcher/internal/filter/exclude_test.go:95
        	Error:      	Error "CreateFile C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\TestExcludeOlderThanFilterfile_not_present764582634\\001\\b.log: The system cannot find the file specified." does not contain "b.log: no such file or directory"
        	Test:       	TestExcludeOlderThanFilter/file_not_present

=== FAIL: fileconsumer/matcher/internal/filter TestExcludeOlderThanFilter (re-run 1) (0.01s)

DONE 2 runs, 3282 tests, 13 skipped, 4 failures in 104.549s
make[2]: *** [../../Makefile.Common:126: test] Error 1
make[1]: *** [Makefile:165: pkg/stanza] Error 2
make[1]: *** Waiting for unfinished jobs....
✓  . (1.353s)

DONE 121 tests in 5.801s
make[1]: Leaving directory 'D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib'
make: *** [Makefile:113: gotest] Error 2

Potentially related to #32299, where the solution was to use filepath.Join for paths to work properly on Windows.

@crobert-1 crobert-1 added needs triage New item requiring triage os:windows labels Apr 16, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member Author

@crobert-1
Copy link
Member Author

djaglowski pushed a commit that referenced this issue Apr 17, 2024
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Test error message:
```
Error:      	Error "CreateFile C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\TestExcludeOlderThanFilterfile_not_present318488423\\001\\b.log: The system cannot find the file specified." does not contain "b.log: no such file or directory"
```
This is simply saying the error message on Windows doesn't contain the
expected error message. However, we can tell from the output that the
test is working as intended. This updates the test to use the proper
error message on Windows to determine if it's successful.

**Link to tracking Issue:** <Issue number if applicable>
Resolves
#32464

**Testing:** <Describe what testing was performed and which tests were
added.>
I've added the `Run Windows` label to confirm this is working as
intended.
rimitchell pushed a commit to rimitchell/opentelemetry-collector-contrib that referenced this issue May 8, 2024
…32474)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Test error message:
```
Error:      	Error "CreateFile C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\TestExcludeOlderThanFilterfile_not_present318488423\\001\\b.log: The system cannot find the file specified." does not contain "b.log: no such file or directory"
```
This is simply saying the error message on Windows doesn't contain the
expected error message. However, we can tell from the output that the
test is working as intended. This updates the test to use the proper
error message on Windows to determine if it's successful.

**Link to tracking Issue:** <Issue number if applicable>
Resolves
open-telemetry#32464

**Testing:** <Describe what testing was performed and which tests were
added.>
I've added the `Run Windows` label to confirm this is working as
intended.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant