Skip to main content
WinFsp-MemFs-Extended includes two specialized testing utilities to verify filesystem functionality and performance under various conditions.

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

RandomFilesTester.exe <FolderPath> <NumberOfFiles> [FileSize]
Parameters:
  • FolderPath - Target directory where files will be created (e.g., R:\test)
  • NumberOfFiles - How many files to generate
  • FileSize - (Optional) Size of each file in bytes (default: 5120 bytes)

Example

# Create 1000 random files of 5KB each in R:\test
RandomFilesTester.exe R:\test 1000

# Create 500 random files of 10KB each
RandomFilesTester.exe R:\test 500 10240

How it works

  1. The utility generates random binary data using a seeded random generator
  2. Creates files named Random0.bin, Random1.bin, etc. in the target folder
  3. Writes the random data to each file
  4. Waits for user input (press any key)
  5. Deletes all generated files when you press a key
The random seed is always 0, ensuring reproducible file content across runs for consistent testing.

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

ConcurrencyStressTester.exe <DurationSec> <Procedures>
Parameters:
  • DurationSec - How long to run the stress test in seconds
  • Procedures - Either all to 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

# Run all stress tests for 60 seconds
ConcurrencyStressTester.exe 60 all

# Run only FileCreator and ReadWrite tests for 30 seconds
ConcurrencyStressTester.exe 30 0,2

# Run only the ReadWrite procedure for 120 seconds
ConcurrencyStressTester.exe 120 2

How it works

  1. The tester displays available procedures and which are selected
  2. Prompts you to press Enter to begin testing
  3. Changes working directory to the target folder
  4. Runs selected procedures concurrently for the specified duration
  5. Each procedure runs in multiple threads, performing operations repeatedly
  6. After each operation, verifies the results to ensure data integrity
  7. Reports success or failure with detailed error information

Running tests on your RAM disk

To test your WinFsp-MemFs-Extended instance:
  1. Mount the RAM disk:
    memefs-x64.exe -i -F NTFS -u "" -m R:
    
  2. Navigate to the test directory:
    cd R:\
    mkdir test
    cd test
    
  3. Run RandomFilesTester:
    RandomFilesTester.exe R:\test 1000
    
  4. Run ConcurrencyStressTester:
    ConcurrencyStressTester.exe 60 all
    

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
If you encounter failures, they may indicate:
  • 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

Build docs developers (and LLMs) love