Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do this, or should we wait longer in the tests? Can't we wait until the Cosmos contianer says "ready"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do wait for cosmos to do that. And we invoke other endpoints that work:
That last one is
aspire/playground/CosmosEndToEnd/CosmosEndToEnd.ApiService/Program.cs
Lines 17 to 46 in 0587e48
So, I would expect
/efto work fine too. But it often times out like in this log.And the exceptions before retries are like:
Note
'timeout: 65000 Msin theCosmosException. Looking at the trace, my understanding is that this is the timeout from efcore, which does seem to use 65 secs default timeout for cosmos.I'm not sure why it takes longer for the
/efcase.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the emulator is running, waiting over 1 minute to execute a query seems crazy. I'm not sure waiting for another minute is going to help.
@roji @AndriySvyryd @ajcvickers - Is there anything special about the EF cosmos client here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why, but it does seem to help. I tried to run the same test 6 times on the CI in one run, and trying that twice it didn't fail. I can test more iterations too.
It would be great to find out if that is reliable or not, and why this takes longer.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shouldn't be, see https://github.com/dotnet/efcore/blob/main/src/EFCore.Cosmos/Storage/Internal/SingletonCosmosClientWrapper.cs#L32
From https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/troubleshoot-dotnet-sdk-request-timeout?tabs=cpu-new: