Long-running operation promise never resolves
Calls to endpoints with long-running operations return an array with an operation object and an API response. You are supposed to be able to call operation.promise() which should resolve when the operation completes. In the scenario where the API response object's done property is set to true (in other words, the operation completed immediately), the promise never resolves.
Environment details
- OS: Linux
- Node.js version: 8.16.0
- npm version: 6.4.1
dialogflowversion: 0.12.1
Steps to reproduce
The issue may be hard to reproduce because it only seems to happen when the initial api response has done: true.
- Perform an
importAgentfunction, i.e.const [op, resp] = agentsClient.importAgent() - Call
op.promise().
Hey @jdelman a few questions for you:
- what runtime environment are you running in (Cloud Functions, Kubernetes Engine, App Engine?).
- is this happening intermittently, some of the time?
@bcoe -
- Running in a local development environment inside Docker right now.
- It does seem to happen intermittently - it seems to depend on the size or complexity of the agent imported, as some agents take longer and therefore do not return
done: truewith the initial response fromimportAgent.
@alexander-fenster any thoughts on this? I haven't played much with long-running operations, any additional debugging information that might be useful.
@bcoe I reproduced it just by adding a unit test on this condition in google-gax. It's amazing that it's the first time it's reported :) I will fix it today.
@jdelman I was too fast stating that - it was some other problem that caused that failure for me. It actually works both in my unit test and when I try running the test code with an actual gRPC server returning an actual Operation with done set to true.
I will try reproducing it with dialogflow library and importAgent call as you suggest, and will let you know.
@alexander-fenster any updates here? Possibly related to #381
This issue seems to now be obsolete. Closing this issue. Please, reopen if needed.