Skip to content

Commit

Permalink
[Ingest Manager] Fix limited concurrency helper (#73976)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet authored Jul 31, 2020
1 parent d9efd26 commit 357139d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('registerLimitedConcurrencyRoutes', () => {
});

// assertions for calls to .decrease are commented out because it's called on the
// "req.events.aborted$ observable (which) will never emit from a mocked request in a jest unit test environment"
// "req.events.completed$ observable (which) will never emit from a mocked request in a jest unit test environment"
// https://github.com/elastic/kibana/pull/72338#issuecomment-661908791
describe('preAuthHandler', () => {
test(`ignores routes when !isMatch`, async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ export function createLimitedPreAuthHandler({

maxCounter.increase();

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

Expand Down

0 comments on commit 357139d

Please sign in to comment.