Skip to content
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

[1.x][Test] Fix console error in search_service.test.ts  #671

Merged
merged 1 commit into from
Jul 26, 2021

Commits on Jul 26, 2021

  1. [1.x][Test] Fix console error in search_service.test.ts 

    Run unit test suite search_service.test.ts has a console error:
    ```
    UnhandledPromiseRejectionWarning: TypeError: Cannot read
    property 'aggs' of undefined
    ```
    
    This is caused by a missing promise result check in the setup fun
    in search_service.ts. If the promise result is empty (or null/undefined),
    then any properties of the empty result is undefined. In our case,
    `aggs` in `if (value.search.aggs.shardDelay.enabled)` is undefined.
    In this PR, we fixed this issue by adding a value check in setup fun.
    
    Issues resolved:
    opensearch-project#594
    
    Backport PR:
    opensearch-project#595
    
    Signed-off-by: Anan Zhuang <ananzh@amazon.com>
    ananzh committed Jul 26, 2021
    Configuration menu
    Copy the full SHA
    83ba64a View commit details
    Browse the repository at this point in the history