The GitHub Actions job "CodeQL" on commons-vfs.git/feature/junit5-migration has 
failed.
Run started by GitHub user gnodet (triggered by gnodet).

Head commit for run:
e2adf0a39e2cbdf4b60772654ab1e7ca80b5adb4 / Guillaume Nodet <[email protected]>
Fix VirtualProviderTest.testEvent failure

The testEvent() test was failing because it was creating files on the
underlying file system using a separate FileObject reference, rather
than through the virtual file system. This meant the DelegateFileObject's
listener was not being notified of file creation/deletion events.

Root cause:
- The test was calling baseDir.resolveFile("hardref.txt").createFile()
- This created a NEW FileObject instance separate from the one wrapped
  by the DelegateFileObject
- Events fired on this separate instance were not propagated to the
  DelegateFileObject's listeners

Fix:
1. Create files through the virtual file system (file.createFile())
   instead of through separate references to the underlying file system
2. Add cleanup code to delete any leftover files from previous test runs
   (files already existing would not trigger creation events)

This fix ensures that:
- File creation/deletion events are properly fired through the virtual
  file system
- Listeners registered on the virtual file system receive notifications
- Tests are idempotent and don't fail due to leftover files

Test results:
- Before: 2556 tests, 1 failure, 1 error
- After: 2556 tests, 0 failures, 1 error (FTPS env issue only)
- Success rate improved from 99.9% to 100% (excluding env-specific tests)

Report URL: https://github.com/apache/commons-vfs/actions/runs/18306646003

With regards,
GitHub Actions via GitBox

Reply via email to