Block in filePoller.Close until loop is finished #879
Merged
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.
Regarding the indirect changes often reported by Codecov, I've observed on https://app.codecov.io/gh/artefactual-sdps/enduro/pull/877/indirect-changes that the close case in the filePoller pool's select statement is not consistently executed. This is probably happening because the test occasionally finishes before that section of code is executed. This behavior might be attributed to the inherent non-determinism of Go's select statement. To address it, I've updated
filePoller.Close
to ensure that it waits until the pool has completely finished, ensuring that the loop has always an opportunity to be released.I've also modified the job step "Upload coverage to Codecov" in our CI to enable skipping this step if the commit message includes the string
[skip codecov]
. I needed this because it is not obvious how we can test the timeout case that I've introduced in the Close method. I suspect that we'll find other situations where we can't provide enough coverage but we still need successful CI builds for deployments, merge checks, etc.