Skip to content

[tests] SearchApiRuntimeFieldsTests can return null values #5446

Closed
@Mpdreamz

Description

@Mpdreamz

Failed collections:

  • ReadOnly: Tests.Search.Search.SearchApiRuntimeFieldsTests
    ---Reproduce: -----
    ./build.sh seed:99540 random:sourceserializer random:typedkeys random:httpcompression:false integrate 8.0.0-SNAPSHOT "readonly" "searchapiruntimefields"

Sometimes the fields returned are null and our assertions are not setup to handle that.

ests.Framework.EndpointTests.ResponseAssertionException : Expected response.Hits.First().Fields.ValueOf<ProjectRuntimeFields, string>(p => p.StartedOnDayOfWeek) not to be <null> or empty, but found <null>.
Response Under Test:
Valid NEST response built from a successful (200) low level call on POST: /project/_search?pretty=true&error_trace=true&typed_keys=true
# Audit trail of this API call:
 - [1] HealthyResponse: Node: http://localhost:9200/ Took: 00:00:00.0296053
# Request:
{"fields":["runtime_started_on_day_of_week",{"field":"runtime_thirty_days_after_started","format":"basic_date"},"search_runtime_field"],"query":{"match_all":{}},"size":5,"runtime_mappings":{"search_runtime_field":{"script":{"lang":"painless","source":"if (doc['type'].size() != 0) {emit(doc['type'].value.toUpperCase())}"},"type":"keyword"}}}
# Response:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions