Skip to content

Commit 07ea12d

Browse files
authored
[Ingest Manager] Fix limited concurrency helper (#73976) (#73994)
1 parent 3af6811 commit 07ea12d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

x-pack/plugins/ingest_manager/server/routes/limited_concurrency.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('registerLimitedConcurrencyRoutes', () => {
3939
});
4040

4141
// assertions for calls to .decrease are commented out because it's called on the
42-
// "req.events.aborted$ observable (which) will never emit from a mocked request in a jest unit test environment"
42+
// "req.events.completed$ observable (which) will never emit from a mocked request in a jest unit test environment"
4343
// https://github.com/elastic/kibana/pull/72338#issuecomment-661908791
4444
describe('preAuthHandler', () => {
4545
test(`ignores routes when !isMatch`, async () => {

x-pack/plugins/ingest_manager/server/routes/limited_concurrency.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ export function createLimitedPreAuthHandler({
6666

6767
maxCounter.increase();
6868

69-
// requests.events.aborted$ has a bug (but has test which explicitly verifies) where it's fired even when the request completes
70-
// https://github.com/elastic/kibana/pull/70495#issuecomment-656288766
71-
request.events.aborted$.toPromise().then(() => {
69+
request.events.completed$.toPromise().then(() => {
7270
maxCounter.decrease();
7371
});
7472

0 commit comments

Comments
 (0)