Skip to content

Conversation

@PhracturedBlue
Copy link
Contributor

This is an attempt to make the socket-activated tests more robust by running them in their own process with the proper file-descriptors rather than trying to hack the FDs with syscalls (a method that seems not very robust). The downside is that it requires a kopia executable, which means it can't run with 'go test' (or 'make test') and so I added it to the integration tests (which should still be run as part of CI)

This should fix #3313

The tests run ok for m, but I don't have the CI env, and can't seem to run 'ci-integration-tests' so we'll have to see if it works properly in the workflow.

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.01% 🎉

Comparison is base (1f70992) 75.85% compared to head (7f2c7cf) 75.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3318      +/-   ##
==========================================
+ Coverage   75.85%   75.87%   +0.01%     
==========================================
  Files         462      462              
  Lines       37075    37075              
==========================================
+ Hits        28125    28130       +5     
+ Misses       7022     7018       -4     
+ Partials     1928     1927       -1     

see 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PhracturedBlue PhracturedBlue changed the title fix(cli) Attempt to fix socket-activated tests fix(cli): Attempt to fix socket-activated tests Sep 18, 2023
@jkowalski jkowalski changed the title fix(cli): Attempt to fix socket-activated tests test(cli): Attempt to fix socket-activated tests Sep 19, 2023
@jkowalski jkowalski merged commit 0f608ff into kopia:master Sep 19, 2023
julio-lopez added a commit to julio-lopez/kopia that referenced this pull request Nov 14, 2025
julio-lopez added a commit to julio-lopez/kopia that referenced this pull request Nov 14, 2025
julio-lopez added a commit to julio-lopez/kopia that referenced this pull request Nov 14, 2025
julio-lopez added a commit that referenced this pull request Nov 14, 2025
Objective: make the tests more robust and reduce random failures.

Preliminary refactoring:
- Accept testing.TB in testenv helpers. This is needed to
  use `require.EventuallyWithT` in socket activation tests.
- Rename parameters for clarity

Tests refactoring:
- use t.Cleanup instead of defer where appropriate
- create file handlers in test routine instead of go routines
- remove unnecessary var declaration
- increased wait time to 30 seconds.
- allow running socket activation test on Darwin

Ref:
- #3283
- #3313
- #3318
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.

Bug: The socket-activation test is not robust enough

2 participants