Skip to content

fix: tests, ci failures, minor dep updates#52

Merged
galt-tr merged 7 commits into
mainfrom
fix/ci-checks
Apr 30, 2026
Merged

fix: tests, ci failures, minor dep updates#52
galt-tr merged 7 commits into
mainfrom
fix/ci-checks

Conversation

@mrz1836
Copy link
Copy Markdown
Collaborator

@mrz1836 mrz1836 commented Apr 30, 2026

This pull request introduces several dependency updates, improvements to server-sent events (SSE) handling, and minor codebase cleanups. The most significant changes are grouped below:

Dependency Updates:

  • Upgraded many dependencies in go.mod to their latest versions, including major libraries such as github.com/IBM/sarama, github.com/aerospike/aerospike-client-go/v7, github.com/bsv-blockchain/teranode, github.com/gin-gonic/gin, go.uber.org/zap, and various indirect dependencies. These updates improve security, performance, and compatibility. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

SSE (Server-Sent Events) Handling Improvements:

  • Added a closed flag and close() method to the sseWriter struct to ensure that no writes occur after the HTTP response is being finalized, preventing potential race conditions and panics.
  • Updated SSE stream handlers (handleTipStream and handleReorgStream) to call writer.close() when a client disconnects, ensuring proper cleanup. [1] [2]
  • Enhanced the sseStoreStub used in tests with mutex protection for its fixtures, ensuring thread-safety and avoiding race conditions during concurrent access.

Testing and Code Quality:

  • Refactored test harness code to use a thread-safe setStatus method for updating transaction statuses, improving reliability of SSE E2E tests.
  • Improved documentation and code comments for clarity, especially around concurrency and mutation safety in tests and core functions. [1] [2]

Benchmark and Test Infrastructure:

  • Simplified and stabilized the Postgres benchmark setup by reusing a shared store and skipping tests if unavailable, reducing setup time and flakiness.

Function Return Value Correction:

  • Fixed the return value of multiSubtreeTestSetup to return all expected results, improving test correctness.

mrz1836 added 6 commits April 30, 2026 09:39
Bump versions for several dependencies to ensure compatibility and security.
Modified the return values of multiSubtreeTestSetup to include allLeaves, subtreeHashes, and blockRoot for improved data handling in tests.
Added a closed flag to sseWriter to ensure that no writes occur after the writer is closed, preventing potential errors during HTTP response finalization.
Refactored status management in sseStoreStub to use a dedicated setStatus method for better concurrency control and clarity.
Refactored input normalization to avoid race conditions by computing defaults into local variables. This change ensures that shared input slices across goroutines remain unmodified, preventing potential data races.
@mrz1836 mrz1836 requested a review from galt-tr April 30, 2026 13:41
@mrz1836 mrz1836 added dependencies Dependency updates, version bumps, etc. test Unit tests, mocking, integration testing go Pull requests that update go code labels Apr 30, 2026
@github-actions github-actions Bot added size/XL Very large change (>500 lines) bug-P3 Lowest rated bug, affects nearly none or low-impact chore Simple dependency updates or version bumps labels Apr 30, 2026
@galt-tr galt-tr merged commit 62888e3 into main Apr 30, 2026
48 checks passed
@github-actions github-actions Bot deleted the fix/ci-checks branch April 30, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-P3 Lowest rated bug, affects nearly none or low-impact chore Simple dependency updates or version bumps dependencies Dependency updates, version bumps, etc. go Pull requests that update go code size/XL Very large change (>500 lines) test Unit tests, mocking, integration testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants