Bird
0
0

You want to test a distributed system's behavior under network partitions and message reordering. Which approach best achieves this?

hard📝 Trade-off Q8 of 15
Microservices - Testing Microservices
You want to test a distributed system's behavior under network partitions and message reordering. Which approach best achieves this?
AUse a network simulator that can inject delays, drop packets, and reorder messages
BRun all services on the same machine without network simulation
CTest only the services independently without network effects
DUse unit tests that mock all network calls
Step-by-Step Solution
Solution:
  1. Step 1: Identify testing needs for network faults

    Network partitions and message reordering require simulating complex network behaviors.
  2. Step 2: Evaluate testing approaches

    Only a network simulator that injects delays, drops, and reorders messages can test these scenarios realistically.
  3. Final Answer:

    Use a network simulator that can inject delays, drop packets, and reorder messages -> Option A
  4. Quick Check:

    Network simulator = realistic fault injection [OK]
Quick Trick: Simulate network faults with specialized tools [OK]
Common Mistakes:
  • Ignoring network effects by running on one machine
  • Testing services independently misses network faults
  • Relying only on mocks misses real network behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes