Kibana: Rollup app test throwing unhandled promise rejection

Created on 2 Jun 2020  Â·  12Comments  Â·  Source: elastic/kibana

I am getting an Unhandled Promise rejection detected error and it is terminating the Kibana FTR, when this happens I don't get a report generated to see all the failures.

I am not sure of the root cause of this issue but it looks like a cloud issue on staging, I filed a separate issue.

Version: 7.9.0-SNAPSHOT
Platform: Cloud
Build: 282

         â””-: rollup job
           â””-> "before all" hook
           â””-: rollup job
             â””-> "before all" hook
             â””-> create new rollup job
               â””-> "before each" hook: global before each

Unhandled Promise rejection detected:

{ Error: Service Unavailable
at respond (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackGrp4/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/elasticsearch/src/lib/transport.js:349:15)
at checkRespForFailure (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackGrp4/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/elasticsearch/src/lib/transport.js:306:7)
at HttpConnector. (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackGrp4/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
at IncomingMessage.wrapper (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackGrp4/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/node_modules/elasticsearch/node_modules/lodash/lodash.js:4929:19)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
status: 503,
displayName: 'ServiceUnavailable',
message: 'Service Unavailable',
path: '/to-be-06-01-2020/_doc',
query: {},
body:
{ ok: false,
message: 'The requested deployment is currently unavailable.' },
statusCode: 503,
response:
'{"ok":false,"message":"The requested deployment is currently unavailable."}n',
toString: [Function],
toJSON: [Function] }

Terminating process...

Rollups Elasticsearch UI failed-test test-cloud

Most helpful comment

The await is inside of the function passed to pastDates.map() which breaks the promise chain. The code should be:

for (const day of pastDates) {
  await es.index(mockIndices(day, rollupSourceDataPrepend));
}

or, if you want it to happen in parallel:

await Promise.all(
  pastDates.map(async (day) => {
    await es.index(mockIndices(day, rollupSourceDataPrepend));
  })
)

All 12 comments

Pinging @elastic/kibana-test-triage (failed-test)

Pinging @elastic/kibana-security (Team:Security)

I am not sure of the root cause of this issue but it looks like a cloud issue on staging, I filed a separate issue.

I agree based on the error message that this looks like a cloud issue, but let us know if that's not the case, or if there's something we can do to help stabilize this test for cloud

Thanks @legrego we need a test fix so it does not terminate on unhandled promise rejection error.

Does this test consistently fail on cloud, or was it transient? Looking at this test suite, I don't see how it's any different from the other functional tests in terms of how rejected promises are handled.

So far it is failing consistently I wonder if one of the tests is causing it, looking into it.

Anyway for the rejected promise, sorry I missed it as the text alignment was off, this is not the spaces app that is causing the failure, it is the rollup job app. I will forward to correct team :)

Pinging @elastic/es-ui (Team:Elasticsearch UI)

I think this has already been fixed.

I am a little confused. Perhaps I am using the git blame UI wrong but does this screenshot not show that the original code that commited the change had await there? Again, I am not a git blame expert.

Screen Shot 2020-06-15 at 4 56 24 PM

@liza-mae @spalger

The await is inside of the function passed to pastDates.map() which breaks the promise chain. The code should be:

for (const day of pastDates) {
  await es.index(mockIndices(day, rollupSourceDataPrepend));
}

or, if you want it to happen in parallel:

await Promise.all(
  pastDates.map(async (day) => {
    await es.index(mockIndices(day, rollupSourceDataPrepend));
  })
)

I gotcha. Outside of the scope.

Was this page helpful?
0 / 5 - 0 ratings