SShortSingh.
Back to feed

Separating Liveness and Readiness Probes for Mock Servers to Prevent Flaky Tests

0
·10 views

A mock server in a container should expose distinct liveness and readiness checks rather than one endpoint that reports success as soon as the process starts. Routes are only registered after the spec is read and examples are resolved, so a server can be reachable before it can actually answer the expected endpoints. Premature traffic in that window causes intermittent resets and 404s that look like test flakiness. Liveness should restart a dead process, while readiness should hold traffic back until the contract has loaded. Orchestration can wait on readiness, and a startup probe or generous failure threshold can accommodate slow loads without causing premature restarts.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Custom Booking Platform or Off-the-Shelf Software? A Guide for Service Businesses

This guide helps service businesses decide between custom booking software and ready-made tools by weighing cost, fit, data ownership and growth. It recommends first mapping the current booking flow to find where work piles up. Standard off-the-shelf tools are presented as the better choice for typical flows because of their speed, lower price and easier maintenance. A custom platform is justified when unique business rules cause manual work, double bookings or lost jobs. The article also urges checking data export rights and who can maintain the system if the builder leaves.

0
ProgrammingDEV Community ·

How to Compare Cybersecurity Courses Before You Enrol

Choosing a cybersecurity course can be difficult for beginners, since many programs cover similar topics and advertise comparable tools. The article argues that price and promotional claims are not reliable guides, and that learners should check whether a course matches their goals. It recommends reviewing the syllabus for a logical progression through foundational subjects such as networking, operating systems, scripting and web security. Prospective students should also look for hands-on practice in authorised lab environments and assess trainer quality, course duration and pacing. Finally, it cautions that certificates alone should not determine a choice, since employers typically look for demonstrated understanding and applied skills.

0
ProgrammingDEV Community ·

REST, GraphQL or gRPC: A Quick Guide to Choosing an API Style

Many teams pick an API style based on past experience, which can lock them into a choice for years. The article argues the decision can be made quickly by answering three questions about your system. Who calls the API, how varied the clients' data needs are, and how much inter-service speed matters. Public-facing APIs point toward REST for its broad tooling and HTTP caching, while internal, performance-sensitive services suit gRPC. Multiple clients with differing data requirements make GraphQL worthwhile despite its added complexity.

0
ProgrammingDEV Community ·

How to set Claude Code's base URL for a relay and verify the relay really serves Claude

The article explains how Claude Code uses the ANTHROPIC_BASE_URL variable to redirect API traffic through a proxy, and how ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY set the credential header. It notes that some providers route Claude Code to non-Claude models via the same mechanism, which Anthropic does not support through gateways. To check a relay, the author recommends behavioral tests rather than asking the model its identity, such as a Python tool called claude-relay-check that tests response format, prompt caching, and thinking-block signatures. A second tool, ModelTrace, estimates the model family from generated digit distributions but is described as only a hint. The piece is written by the operator of a relay, which the author discloses.