Skip to content

Commit

Permalink
[Ingest Manager] Fix limited concurrency helper
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Jul 31, 2020
1 parent 708a30a commit e8d428b
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 e8d428b

Please sign in to comment.