-
Notifications
You must be signed in to change notification settings - Fork 2
Run tests on effection v4 #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
taras
wants to merge
42
commits into
main
Choose a base branch
from
tm/try-v4
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71c04be to
9913264
Compare
daf5aec to
6f4feee
Compare
- Created tasks/generate-importmap.ts to automatically collect all external dependencies from workspace packages - Added "generate-importmap" task to root deno.json - Replaced @gordonb/pipe with remeda in watch package - Updated all remeda versions to ^2 - Added ws dependency to websocket package - Added v4.importmap.json to .gitignore (generated file)
… events in for-each tests
…g on results length
- Read exports field from each package's deno.json - Support both string and object export formats - Map workspace packages to their actual export paths - Automatically add @std/testing sub-packages (/bdd, /mock, /time) - Force all packages to use effection v4
- Rewrite batch implementation to use iterator-based approach with timebox - Remove all console.log debug statements from batch - Add sleep(1) calls in tests for operation tree setup timing - Update batch tests to use signal convergence patterns - Refactor tracker tests to use createArraySignal and is() - Remove unused imports from test files - Add @effectionx/timebox dependency to stream-helpers
- Initialize next with done=true to handle stream completion properly - When lastPull times out, halt it and clear the reference before checking next - When lastPull resolves, use its result as next instead of pushing to batch - Move subscription.next() into else block to avoid duplicate calls - Return next directly at end to propagate done state correctly - When lastPull exists at the start of next(), wrap it in a timebox to respect maxTime. If the timeout occurs, halt the task instead of waiting indefinitely. This fixes the hanging test where forEach would wait indefinitely for more items after the source stream was exhausted.
f3ad201 to
0e48239
Compare
Increases batch test timing tolerances and adds automated stress testing with stress-ng. Run tests: dagger call test-v-3-stress --rounds 100 export --path ./v3-summary.log --progress=plain dagger call test-v-4-stress --rounds 100 export --path ./v4-summary.log --progress=plain Results show V4 has resource leaks in watch tests under CPU stress (chokidar cleanup issue).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
All extensions were migrated to v3 in #87, but we now want to be able to run tests on v4 which requires using import maps to switch dependencies.
Approach
deno task generate-importmapto generatev4.importmap.jsondeno test --import-map v4.importmap.json -Ato run testsTests with `spawn()` followed by `sleep(1)` pattern
Test: "creates a batch within maxTime when maxSize is never reached"
effectionx/stream-helpers/batch.test.ts
Lines 57 to 67 in 9913264
Test: "creates a batch within maxSize in maxTime window"
effectionx/stream-helpers/batch.test.ts
Lines 93 to 99 in 9913264
Test: "waits for all items to be processed"
effectionx/stream-helpers/tracker.test.ts
Lines 27 to 36 in 9913264
Test: "tracks batched items"
effectionx/stream-helpers/tracker.test.ts
Lines 70 to 78 in 9913264
Test: "creates a faucet that can pour items"
effectionx/stream-helpers/test-helpers/faucet.test.ts
Lines 21 to 22 in 9913264
Test: "supports pouring with an operation"
effectionx/stream-helpers/test-helpers/faucet.test.ts
Lines 73 to 74 in 9913264
Test: "stops pouring when closed"
effectionx/stream-helpers/test-helpers/faucet.test.ts
Lines 102 to 103 in 9913264
Test: "should invoke function for each item in the stream"
effectionx/stream-helpers/for-each.test.ts
Lines 22 to 23 in 9913264
Test: "should return the close value of the stream"
effectionx/stream-helpers/for-each.test.ts
Lines 44 to 45 in 9913264
Test: "waits until the value of the stream matches the predicate"
effectionx/signals/helpers.test.ts
Lines 21 to 22 in 9913264
Test: "does not send a value to the stream when the set value is the same as the current value"
effectionx/signals/array.test.ts
Lines 47 to 48 in 9913264
Test: "closes and opens the valve"
effectionx/stream-helpers/valve.test.ts
Lines 31 to 39 in 9913264
Test: "shuts down gracefully"
effectionx/worker/worker.test.ts
Lines 75 to 89 in 9913264
Total: 13 instances across 8 test files