Race conditions and asynchronous systems
Unlike synchronous applications, which will execute from beginning to end deterministically every time based on their inputs, asynchronous applications depend on external independent systems. Those systems may be external, third parties with which you share information, send commands, or separate parts of your internal implementation.
Testing these interactions requires different approaches to find another class of bug. Consider an asynchronous application that sends requests to two different external systems and then waits for their responses:
Figure 12.4 – Sending messages to external systems and receiving replies in order B then C
Application A has a bug and relies on responses coming from Application B before Application C. Generally, that is the case, and Application B processes the queries faster and returns its responses first. However, if Application B is ever delayed, Application C will return first...