Azure / Azure/azure-functions-host

Testing for timeout exceptions

Open
#8,366 0 comments 0 reactions 1 assignee Claimed by @soninaren View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 11h
Merged PRs (30d)
37

Description

We need a mechanism to test timeout exceptions during development time. This is important when we are doing changes related to timeouts, we don't realize if that piece of code will throw any error after timeout is reached (10 minutes or so). In some cases, these timeouts are around 10 minutes which means we need to wait for 10 minutes to see such errors happening. An approach could be to allow error showing up with reduced timeout during integration testing.

**Example scenario -**
We were getting workerTimeout exceptions due to event being incorrectly configured.
Commit reverted to solve the issue - https://github.com/Azure/azure-functions-host/pull/8346
The issue was that there were 2 subscriptions for 1 GRPC request (incorrectly configured), so the other subscription was getting timed out.

Also, another time related improvement for unit tests is to have a way to run UTs for a shorter wait time (instead of actual wait time).

For example - Below UT waits for actual wait time (25 seconds), instead we can have a simulated shorter time to quickly run the test
https://github.com/Azure/azure-functions-host/blob/b2ed903d20416157cc8d3730246e642d3e6ed9e5/src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs#L147

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.