Bird
0
0

During end-to-end testing, a service returns stale data due to caching. How should this be addressed?

medium📝 Analysis Q7 of 15
Microservices - Testing Microservices
During end-to-end testing, a service returns stale data due to caching. How should this be addressed?
ADisable all services except the one tested
BIgnore cache and trust service response
CInvalidate or bypass cache during tests
DIncrease cache duration
Step-by-Step Solution
Solution:
  1. Step 1: Identify caching impact

    Caching can cause stale data to appear in tests, leading to false results.
  2. Step 2: Testing best practice

    Invalidate or bypass cache to ensure fresh data during end-to-end tests.
  3. Final Answer:

    Invalidate or bypass cache during tests -> Option C
  4. Quick Check:

    Cache stale data fix = Invalidate cache [OK]
Quick Trick: Bypass cache to get fresh data in tests [OK]
Common Mistakes:
  • Trusting cached data without validation
  • Disabling unrelated services unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes