Skip to content

refactor(queue/mysql): event-driven integration tests, zero sleeps#132

Merged
behinddwalls merged 1 commit into
mainfrom
preetam/test-time-usage
Mar 10, 2026
Merged

refactor(queue/mysql): event-driven integration tests, zero sleeps#132
behinddwalls merged 1 commit into
mainfrom
preetam/test-time-usage

Conversation

@behinddwalls
Copy link
Copy Markdown
Collaborator

@behinddwalls behinddwalls commented Mar 9, 2026

Summary

  • Add OnSignal chan HookSignal to subscriber with two behavioral signals (SignalDeliveryCheck, SignalPartitionUpdate) for event-driven test waits
  • Eliminate all 13 time.Sleep, 8 require.Eventually, and 6 inline time.After assertions from integration tests
  • Replace with deterministic helpers: waitForSignal, assertNoDelivery, waitForCondition
  • Add testSubConfig with short lease/visibility timeouts (3s/2s vs 30s/60s defaults) for fast crash recovery tests
  • Add integration test README documenting infrastructure, signal design, and test categories

Test plan

  • make integration-test — all 6 suites pass
  • grep -rn 'time.Sleep' test/integration/extension/queue/ — zero occurrences
  • grep -rn 'require.Eventually' test/integration/extension/queue/ — zero occurrences
  • time.After only inside helper functions as safety-net deadlocks

Test Plan

Issues

@behinddwalls behinddwalls changed the base branch from main to preetam/docs March 9, 2026 06:27
@behinddwalls behinddwalls changed the title refactor(queue/mysql): immutable log, delivery state, heartbeat store, fair leasing refactor(queue/mysql): event-driven integration tests, zero sleeps Mar 9, 2026
@behinddwalls behinddwalls force-pushed the preetam/test-time-usage branch from 024f610 to cedec95 Compare March 9, 2026 06:29
@behinddwalls behinddwalls marked this pull request as ready for review March 9, 2026 06:30
@behinddwalls behinddwalls requested review from a team and sbalabanov as code owners March 9, 2026 06:30
Comment thread extension/queue/mysql/subscriber.go Outdated
Comment thread test/integration/extension/queue/mysql/queue_test.go
Comment thread test/integration/extension/queue/mysql/queue_test.go Outdated
Comment thread test/integration/extension/queue/mysql/queue_test.go Outdated
Comment thread test/integration/extension/queue/mysql/queue_test.go Outdated
Comment thread test/integration/extension/queue/mysql/queue_test.go Outdated
@behinddwalls behinddwalls force-pushed the preetam/test-time-usage branch from cedec95 to 75c37e6 Compare March 10, 2026 02:48
@github-actions github-actions Bot force-pushed the preetam/test-time-usage branch from 75c37e6 to 8050a39 Compare March 10, 2026 03:03
@behinddwalls behinddwalls force-pushed the preetam/test-time-usage branch from 8050a39 to 159dc03 Compare March 10, 2026 03:12
@github-actions github-actions Bot force-pushed the preetam/test-time-usage branch from 159dc03 to 5932823 Compare March 10, 2026 03:34
@github-actions github-actions Bot changed the base branch from preetam/docs to main March 10, 2026 03:34
…n tests

Replace 13 time.Sleep, 8 require.Eventually, and ad-hoc time.After
assertions with event-driven hooks. Add OnSignal channel to subscriber
with typed HookSignal values (SignalDeliveryCheck, SignalPartitionUpdate)
named after behavioral concerns rather than implementation details.

Test helpers (waitForSignal, assertNoDelivery, waitForCondition) use
the signal channel with a 10s safety-net timeout. Zero sleeps remain
in test bodies.
@behinddwalls behinddwalls force-pushed the preetam/test-time-usage branch from 5932823 to dbcad5a Compare March 10, 2026 03:45
@behinddwalls behinddwalls added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit e9fe957 Mar 10, 2026
11 checks passed
@github-actions github-actions Bot deleted the preetam/test-time-usage branch March 10, 2026 05:06
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.

2 participants