Skip to content

refactor: transform test suite to industry-benchmark quality#116

Open
Debanitrkl wants to merge 2 commits intoparseablehq:mainfrom
Debanitrkl:refactor/industry-benchmark-test-suite
Open

refactor: transform test suite to industry-benchmark quality#116
Debanitrkl wants to merge 2 commits intoparseablehq:mainfrom
Debanitrkl:refactor/industry-benchmark-test-suite

Conversation

@Debanitrkl
Copy link

@Debanitrkl Debanitrkl commented Feb 13, 2026

Summary

  • New quest_utils.go: TestMain health gate, WaitForIngest/WaitForQueryable polling helpers, UniqueStream for collision-free names, ResourceTracker (LIFO cleanup via t.Cleanup), RunFlogAuto, and response assertion helpers
  • Replaced all 14x time.Sleep(120s) in quest_test.go with WaitForIngest (2s poll interval, 180s timeout) — tests finish as soon as data is ready instead of always waiting 2 minutes
  • All 13 use case tests (usecase_test.go) rewritten with UniqueStream, WaitForIngest, ResourceTracker, and RunFlogAuto
  • Added t.Helper() to all ~70 utility functions in test_utils.go for accurate failure line reporting
  • Fixed race condition in ConcurrentMultiStreamIngest (nil response dereference)
  • Fixed logic bug in TestSmokeListLogStream (err != nilerr == nil)
  • Merged dependent test pairs (SetRetention+GetRetentionRetentionLifecycle; removed SetAlert+GetAlert superseded by AlertLifecycle)
  • Added t.Parallel() to 16 stateless read-only tests
  • Added data factories (NewSampleJsonWithFields, NewSampleJsonBatch) to model.go

Test plan

  • go vet ./... passes with zero errors (verified locally)
  • No time.Sleep(120 in active code in quest_test.go
  • No Sleep() calls in usecase_test.go
  • Every test creating resources uses ResourceTracker for guaranteed cleanup
  • Run smoke tests against a Parseable instance to validate polling behavior
  • Run with -race flag to verify race condition fix in ConcurrentMultiStreamIngest

🤖 Generated with Claude Code

Debanitrkl and others added 2 commits February 13, 2026 17:10
Replace hardcoded sleeps with polling (WaitForIngest/WaitForQueryable),
guarantee cleanup via ResourceTracker + t.Cleanup, use UniqueStream for
collision-free test names, add t.Helper() to all ~70 utilities, fix race
conditions, and add health gate via TestMain.

Key changes:
- quest_utils.go (NEW): TestMain, WaitForIngest, UniqueStream, ResourceTracker, RunFlogAuto
- model.go: Add NewSampleJsonWithFields/NewSampleJsonBatch data factories
- test_utils.go: t.Helper() on all funcs, fix ConcurrentMultiStreamIngest race
- usecase_test.go (NEW): All 13 use case tests with polling, ResourceTracker, unique names
- quest_test.go: Replace 14x time.Sleep(120s), merge dependent test pairs,
  fix logic bug (err != nil → err == nil), add t.Parallel() to stateless tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove TrackCorrelation, correlation payloads, CRUD utilities,
TestSmokeCorrelationLifecycle, TestUseCase_CorrelationAcrossDifferentSchemas,
and correlation steps from UC5.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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