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

Block in filePoller.Close until loop is finished #879

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

sevein
Copy link
Contributor

@sevein sevein commented Mar 8, 2024

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.

@sevein sevein force-pushed the dev/filenotify-wait-closed branch from c443fa7 to 7380286 Compare March 8, 2024 09:18
@artefactual-sdps artefactual-sdps deleted a comment from codecov bot Mar 8, 2024
@sevein sevein force-pushed the dev/filenotify-wait-closed branch from 7380286 to 73b1476 Compare March 8, 2024 09:29
sevein added 2 commits March 8, 2024 10:03
This is beneficial for housekeeping purposes, waiting until all resources are
released. More precisely, it should produce deterministic outcomes in testing
code, code coverage, etc.

[skip codecov]
@sevein sevein force-pushed the dev/filenotify-wait-closed branch from 73b1476 to 4fb6c55 Compare March 8, 2024 10:03
@artefactual-sdps artefactual-sdps deleted a comment from codecov bot Mar 8, 2024
@djjuhasz djjuhasz self-requested a review March 8, 2024 16:44
Copy link
Collaborator

@djjuhasz djjuhasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@sevein sevein merged commit 5ef8428 into main Mar 8, 2024
10 checks passed
@sevein sevein deleted the dev/filenotify-wait-closed branch March 8, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants