-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Broken QueueScheduler (or TestScheduler) #6586
Comments
I don't believe this is a bug. Prior to the PR you have referenced, it was not possible to properly test code that used the rxjs/src/internal/scheduler/AsyncScheduler.ts Lines 37 to 43 in 881cacd
was patched in the rxjs/src/internal/testing/TestScheduler.ts Lines 374 to 381 in 881cacd
That means that any scheduler used within In the referenced PR, this patching was changed, so each scheduler's implementation is actually what's used in the tests and it's the APIs - like AFAICT, nothing in your StackBlitz's 'queues values' test will schedule actions from within a scheduled action, so the use of rxjs/src/internal/scheduler/AsyncScheduler.ts Lines 30 to 44 in 9a40869
It looks to me like the 'queues values' test was written to test what's actually the I would imagine that it makes sense to use the |
@cartant Thanks for the great explanation! 👍 I was assuming my tests were utilizing Closing this one. |
Bug Report
Current Behavior
scheduled(observable$, queueScheduler)
does not queue up values ( orTestScheduler
is broken)Expected behavior
scheduled(observable$, queueScheduler)
queues up values. 😅Reproduction
We are updating NgRx to RxJS v7 (ngrx/platform#3109) and a few tests started to fail. When bisecting the PRs it was found that
7.0.0-beta.4
works as expected, while7.0.0-beta.5
and on are broken.git bisect
further identified that #5619 is when issue started to happen.In ComponentStore we rely on
queueScheduler
to make sure that all values are executed, and tests that verify it started to fail.Please provide repro code does not involves framework, or other setups to address this bug is specific to rxjs core
Here are TWO min repro tests - one with
scheduled(updater$, queueScheduler)
that queues, and the other with justupdater$
that doesn't does. With RxJS7.0.0-beta.4
both are passing: https://stackblitz.com/edit/jasmine-testing-hv2emp?file=src%2Freducer.spec.tsfirst test:
vs second test:
Except for the "expected" results, the tests are identical.
Failing test
Now here are the same TWO repro tests, but in with RxJS
7.0.0-beta.5
(that includes #5619) and one of the tests is failing. That failing test is usingscheduled(updater$, queueScheduler)
, however the output results are as if it's using justupdater$
withoutscheduled
andqueueScheduler
.Here's the stackblitz: https://stackblitz.com/edit/jasmine-testing-snrg1g?file=src%2Freducer.spec.ts
Environment
7.3.0
.Possible Solution
In ##5619 both the
TestScheduler
andqueueScheduler
are adjusted, so it's hard to tell which one is actually broken. Needs further investigation.The text was updated successfully, but these errors were encountered: