Skip to content

fix: resolve FD leak and correct TimeNamespace validation#36

Open
imshubham22apr-gif wants to merge 1 commit intourunc-dev:mainfrom
imshubham22apr-gif:fix/issues-29-and-30
Open

fix: resolve FD leak and correct TimeNamespace validation#36
imshubham22apr-gif wants to merge 1 commit intourunc-dev:mainfrom
imshubham22apr-gif:fix/issues-29-and-30

Conversation

@imshubham22apr-gif
Copy link
Copy Markdown

Description

This PR resolves two critical issues in the e2e test suite:

  1. File Descriptor Leak: Fixed a leak in the findLineInFile function by ensuring the file is properly closed using defer file.Close().
  2. TimeNamespace Validation: Corrected the namespace validation logic for specs.TimeNamespace. Previously, the code was incorrectly performing a uts namespace comparison. Added support for reading time_for_children from /proc and updated the comparison logic to use the correct namespace map key.

Related issues

How was this tested?

  • Cross-Compilation: Verified that the changes compile successfully for the target platform using GOOS=linux GOARCH=amd64 go test -c ./tests/e2e.
  • Logic Verification: Verified the TimeNamespace comparison logic using a standalone test script to ensure the correct map keys are accessed and the logic is reachable.
  • Integration: Confirmed the fixes are correctly integrated into the e2e test runner.

LLM usage

Assisted for code analysis.

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (Verified via compilation and logic checks).
  • If LLMs were used: I have read the llm policy.

@abhaygoudannavar
Copy link
Copy Markdown

Hi @imshubham22apr-gif thanks for the PR but the issue is not yet reviewd or accepted so please wait until it gets accepted.

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.

FindLineInFile in e2e utils leaks file descriptor [Bug]

2 participants