Skip to content

Attempt to create a test#227

Closed
tbrockman wants to merge 2 commits intozen-fs:mainfrom
tbrockman:cp-sync
Closed

Attempt to create a test#227
tbrockman wants to merge 2 commits intozen-fs:mainfrom
tbrockman:cp-sync

Conversation

@tbrockman
Copy link
Copy Markdown
Contributor

As requested, currently failing:

theodores-MacBook-Pro:zenfs-core theodorebrockman$ npx tsx tests/backend/single-buffer.test.ts 
▶ SingleBuffer
  ✔ filesystem restoration from original buffer (with same metadata) (10.657334ms)
  ✔ cross-thread SharedArrayBuffer (99.360167ms)
  ✖ should recursively copy files with with same stats (28.865125ms)
✖ SingleBuffer (139.574667ms)
ℹ tests 3
ℹ suites 1
ℹ pass 2
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1017.996416

✖ failing tests:

test at tests/backend/single-buffer.test.ts:1:1499
✖ should recursively copy files with with same stats (28.865125ms)
  Exception [Error]: EISDIR: File is a directory, open '/dst'
      at Module._openSync (file:///Users/theodorebrockman/Documents/dev/zenfs-core/dist/vfs/sync.js:227:15)
      at Module.openSync (file:///Users/theodorebrockman/Documents/dev/zenfs-core/dist/vfs/sync.js:238:27)
      at Module.utimesSync (file:///Users/theodorebrockman/Documents/dev/zenfs-core/dist/vfs/sync.js:623:25)
      at Module.cpSync (file:///Users/theodorebrockman/Documents/dev/zenfs-core/dist/vfs/sync.js:850:20)
      at TestContext.<anonymous> (/Users/theodorebrockman/Documents/dev/zenfs-core/tests/backend/single-buffer.test.ts:66:6)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async Test.run (node:internal/test_runner/test:1054:7)
      at async Suite.processPendingSubtests (node:internal/test_runner/test:744:7) {
    errno: 21,
    code: 'EISDIR',
    path: '/dst',
    dest: undefined,
    syscall: 'open'
  }

@james-pre
Copy link
Copy Markdown
Member

At the moment, tests don't use Passthrough at all. The tests in tests/fs run for each backend and have the data copied over— check out tests/setup.ts. The tests in tests/common only run once (rather than for each backend).

I'm not entirely sure why this test is failing.

I think I'm going to write a test in tests/fs to test a lot of files (maybe like 300), which would definitely trigger metadata block rotation. That should prevent a regression of #224, so this test/PR will be entirely optional. Let me know if you'd still like to work on it. If not, that's okay.

@tbrockman
Copy link
Copy Markdown
Contributor Author

I think I'm going to write a test in tests/fs to test a lot of files (maybe like 300), which would definitely trigger metadata block rotation. That should prevent a regression of #224, so this test/PR will be entirely optional. Let me know if you'd still like to work on it. If not, that's okay.

Sounds like you have a better idea than I do about how you'd like to go about testing it! (also am on semi-vacation for the next week or so, so not really writing too much code 👀 )

@tbrockman tbrockman closed this May 16, 2025
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