Skip to content

chore(store): remove dead clock param + fix broken main (transactionRunner in two purger tests)#59

Open
endrju19 wants to merge 2 commits into
mainfrom
chore-remove-dead-clock-from-stores
Open

chore(store): remove dead clock param + fix broken main (transactionRunner in two purger tests)#59
endrju19 wants to merge 2 commits into
mainfrom
chore-remove-dead-clock-from-stores

Conversation

@endrju19
Copy link
Copy Markdown
Collaborator

@endrju19 endrju19 commented Jun 5, 2026

Two related changes in one PR. The first is an urgent fix — main currently does not compile its tests.

1. fix: repair broken main (commit 1)

./gradlew :okapi-core:compileTestKotlin fails on main right now:

OutboxPurgerTest.kt:157  No value passed for parameter 'transactionRunner'.
OutboxPurgerTest.kt:196  No value passed for parameter 'transactionRunner'.

Cause — a semantic merge collision between #55 and #54:

This would have been caught by GitHub's "Require branches to be up to date before merging" (or a merge queue) — worth enabling.

Fix: add the missing transactionRunner = noOpTransactionRunner() to both call sites (the helper already exists in the file and is used by the other 7 purger tests).

2. chore: remove dead clock from the stores (commit 2)

clock became unused in PostgresOutboxStore / MysqlOutboxStore after #58 — that PR replaced the findOldestCreatedAt per-status clock.instant() pre-seed with an empty map, so the stores no longer read a clock at all. (clock was in the stores only to feed that pre-seed, since the very first commit.)

  • Removed the clock constructor parameter + java.time.Clock import from both adapters.
  • Dropped the now-pointless clock pass-through from the two okapi-spring-boot store bean factories (outboxStore()).
  • Updated all store construction sites (benchmarks + integration tests) to the single-arg form PostgresOutboxStore(connectionProvider).
  • Left untouched every clock that still feeds OutboxPublisher / OutboxEntryProcessor / OutboxProcessor / MicrometerOutboxMetrics — those components legitimately take a clock. (Verified no stale clock reference, import, comment, or name remains.)

Breaking change (documented in CHANGELOG): only affects direct constructor users who passed an explicit clock — PostgresOutboxStore(connectionProvider, clock) must drop the second arg. The usual PostgresOutboxStore(connectionProvider) form is unchanged; Spring Boot users are unaffected.

Test plan

  • ./gradlew testClasses — all main + test + jmh sources compile (was failing on main)
  • ./gradlew ktlintCheck — green (no orphaned imports)
  • ./gradlew :okapi-core:test :okapi-spring-boot:test — green (purger tests + autoconfig wiring)
  • ./gradlew :okapi-integration-tests:test --tests "*PostgresOutboxStoreTest" --tests "*MysqlOutboxStoreTest" — green (both adapters against real Postgres + MySQL via Testcontainers)

endrju19 added 2 commits June 5, 2026 14:14
Repairs a broken main from a semantic merge collision between #55 and #54.
#55 added two OutboxPurger tests while transactionRunner was still nullable;
#54 (merged separately) made transactionRunner required but never saw those
two tests. Each PR was green against its own base, but the merged result fails
:okapi-core:compileTestKotlin ("No value passed for parameter 'transactionRunner'").
Adds the missing transactionRunner = noOpTransactionRunner() to both call sites.
… stores

clock became unused after #58 (the lag-gauge fix replaced the per-status
clock.instant() pre-seed with an empty map); the stores derive no timestamps
from a clock. Removes the parameter and its java.time.Clock import from both
adapters, drops the now-pointless clock pass-through from the two
okapi-spring-boot store bean factories, and updates all store construction
sites (benchmarks + integration tests) to the single-arg form.

clock that still feeds OutboxPublisher / OutboxEntryProcessor / OutboxProcessor /
MicrometerOutboxMetrics is left untouched. Breaking change (direct constructor
users who passed an explicit clock) documented in CHANGELOG.
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