internal/plugintest: Switch from (os.File).Readdir() to os.ReadDir() #1056
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference: https://pkg.go.dev/os#File.Readdir
Reference: https://pkg.go.dev/os#ReadDir
While attempting to troubleshoot macOS kernel panic behaviors while running acceptance testing, I was able to capture a log whose last entry was
Symlinking source directories to work directory
. Since that operation tends to occur in temporary directory space, there is at least some potential there for strange macOS and Go behaviors.The
(os.File).Readdir()
method does make this mention in particular:Making this a branch so others potentially affected by macOS kernel panics can try this out. This may not be the root cause, as there is a lot more process-oriented logic that occurs to start and stop providers in the testing framework, but if nothing else it could help.