RandomFilesTester
RandomFilesTester is a C++ utility that creates a large number of files with random content, designed to test basic file creation and deletion operations.Purpose
- Verify file creation and writing operations
- Test filesystem behavior with many small files
- Validate file deletion operations
- Measure file I/O performance at scale
Usage
FolderPath- Target directory where files will be created (e.g.,R:\test)NumberOfFiles- How many files to generateFileSize- (Optional) Size of each file in bytes (default: 5120 bytes)
Example
How it works
- The utility generates random binary data using a seeded random generator
- Creates files named
Random0.bin,Random1.bin, etc. in the target folder - Writes the random data to each file
- Waits for user input (press any key)
- Deletes all generated files when you press a key
ConcurrencyStressTester
ConcurrencyStressTester is a C# multithreaded testing framework that performs concurrent filesystem operations to verify thread-safety and data integrity.Purpose
- Verify thread-safety of filesystem operations
- Test concurrent read/write operations
- Validate data integrity under concurrent access
- Stress test file creation, renaming, and modification operations
Usage
DurationSec- How long to run the stress test in secondsProcedures- Eitherallto run all tests, or a comma-separated list of procedure indices
Available procedures
The tester includes three built-in test procedures:0: FileCreator
- Creates files with random names and random content
- Verifies the written data can be read back correctly
- Deletes files and verifies deletion succeeded
- Tests basic file lifecycle operations
1: FileRenamer
- Creates files and renames them
- Verifies file renaming operations
- Tests file metadata consistency
2: ReadWrite
- Creates 5 files of approximately 500KB each
- Spawns 15 threads (3 threads per file)
- Each thread writes random 16-byte sections at different positions
- Immediately reads back written data to verify correctness
- Tests concurrent read/write operations and data integrity
Examples
How it works
- The tester displays available procedures and which are selected
- Prompts you to press Enter to begin testing
- Changes working directory to the target folder
- Runs selected procedures concurrently for the specified duration
- Each procedure runs in multiple threads, performing operations repeatedly
- After each operation, verifies the results to ensure data integrity
- Reports success or failure with detailed error information
Running tests on your RAM disk
To test your WinFsp-MemFs-Extended instance:-
Mount the RAM disk:
-
Navigate to the test directory:
-
Run RandomFilesTester:
-
Run ConcurrencyStressTester:
Interpreting results
Success indicators
- RandomFilesTester: Successfully creates and deletes all files without errors
- ConcurrencyStressTester: Displays “Successfully done after [duration]” message
- No exceptions or error messages during execution
Failure indicators
- Error messages about file creation or access failures
- VerifyException errors indicating data corruption
- Unexpected crashes or hangs
- Inconsistent file content when read back
- Memory corruption issues
- Thread-safety problems
- Filesystem operation bugs
- Resource exhaustion
Additional testing
Beyond these utilities, you should also test:- Real-world usage scenarios (copying large files, running applications, etc.)
- Integration with Windows Explorer and other file managers
- Performance under sustained load
- Behavior when approaching memory limits
- Compatibility with various file types and applications