Skip to content

test(bench): enable TUS upload performance testing for files up to 1TB#477

Open
pcfreak30 wants to merge 7 commits intodevelopfrom
feat/tus-upload-benchmark
Open

test(bench): enable TUS upload performance testing for files up to 1TB#477
pcfreak30 wants to merge 7 commits intodevelopfrom
feat/tus-upload-benchmark

Conversation

@pcfreak30
Copy link
Copy Markdown
Member

@pcfreak30 pcfreak30 commented Apr 10, 2026

Benchmarks now support testing upload and pinning performance for files ranging from 1GB to 1TB. Tests measure upload duration, throughput, and pin status acquisition with configurable 30-minute timeouts. CPU and memory profiling available via TUS_BENCH_ENABLE_PROFILING.

  • develop
    • test(bench): enable TUS upload performance testing for files up to 1TB 👈

This pull request introduces comprehensive TUS upload performance benchmarking capabilities and refactors test utilities for better code reuse.

Key Changes:

  1. TUS Upload Performance Benchmarking: Added benchmark tests to measure TUS upload performance for large files ranging from 1GB to 1TB. The benchmarks track upload duration, throughput (MB/s), and pin wait times to identify performance bottlenecks in the upload pipeline.

  2. Optional Performance Profiling: Integrated CPU and memory profiling capabilities (controlled via environment variables) to enable detailed performance analysis during benchmark execution.

  3. Test Utility Refactoring: Extracted TUS test helpers and standard test configuration options into shared packages (internal/testing/tus and internal/testing/util) to eliminate code duplication and enable reuse across test suites.

  4. Configurable Test Parameters: Added environment variable support for customizing pin timeout durations and enabling profiling output directories.

The changes enable systematic performance testing of the TUS upload workflow for enterprise-scale file sizes while improving the maintainability of the test codebase through better organization of shared testing utilities.

Benchmarks now support testing upload and pinning performance for files ranging from 1GB to 1TB. Tests measure upload duration, throughput, and pin status acquisition with configurable 30-minute timeouts. CPU and memory profiling available via TUS_BENCH_ENABLE_PROFILING.
@kody-ai

This comment has been minimized.

Regular tests now exclude bench_tests directory. Benchmarks run in separate job with CPU/memory profiling enabled and upload results as artifacts.
Comment thread internal/protocol/bench_tests/op_tus_upload_bench_test.go Outdated
…estopts package

Moved GetStandardTestOptions from internal/testing/util (which imports internal/plugin) to new internal/testing/testopts package to break circular dependency with test packages.
@kody-ai

This comment has been minimized.

Remove go mod download from benchmark job since Go setup already handles module caching.
@blacksmith-sh

This comment has been minimized.

…d tests

Update SetupTUSUpload to return testUser.ID along with protocol and requestID. Update all callers to use the dynamic userID instead of hardcoded value 1 for workflow options and pin status filtering.
@kody-ai

This comment has been minimized.

Set TUS_BENCH_PIN_TIMEOUT=0 to disable timeout limit and allow unlimited wait time for IPFS pin status, which is necessary for multi-GB/TB uploads that may exceed default 30-minute timeout.
@kody-ai

This comment has been minimized.

Check workflow status before entering pin wait loop. If workflow fails, log the status and return early instead of looping forever waiting for pins that will never be created.
@kody-ai
Copy link
Copy Markdown
Contributor

kody-ai Bot commented Apr 10, 2026

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Cross File
Business Logic

Access your configuration settings here.

@blacksmith-sh
Copy link
Copy Markdown
Contributor

blacksmith-sh Bot commented Apr 10, 2026

Blacksmith runners detected OOM events on the following jobs:

Job Details
benchmark View Job

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.

1 participant