proomt

Search

Search posts, papers, and topics

All posts

Freek Van der Herten1 min readintermediate

`exit()` may silently break your parallel tests

Summary

Calling `exit()` inside a test kills the whole PHPUnit worker process, so parallel test runs lose the test result and show no error. Throw an exception instead to let PHPUnit capture the failure and print a stack trace.

  • In parallel test execution (e.g., PHPUnit's `--processes`), `exit()` aborts the entire worker process, bypassing PHPUnit's error handling.
  • The process termination is silent; verbose flags (`-v`, `--debug`) don’t surface the cause because the test runner never regains control.
  • Replace `exit()` with an exception (or let the test fail naturally) so the failure is reported with a stack trace and does not crash other workers.

A single stray `exit()` can make a whole batch of parallel tests appear to pass, hiding real bugs and wasting CI time debugging flaky runs.

5/10

Related reading

  1. Write End-to-End Tests in Your Backend’s Language

    This article advocates writing end-to-end tests in the backend's language to leverage domain models and persistence tools for efficient test data setup. It details a strategy for structuring E2E tests with inline data creation, small helpers, and parallel execution considerations.

    Atomic Objectatomicobject.com7 min
  2. The Flaky Test Confession: “We All Know We’re Ignoring Test Failures”

    Flaky tests silently erode CI reliability, waste compute and developer time, and let real bugs slip into production. The post quantifies the cost (≈2.5 % of developer time, $5.67 per manual investigation vs $0.02 for auto‑rerun) and critiques common band‑aid approaches (retries, quarantine, manual triage). It argues that visibility—detecting flaky tests, predictive test selection, and automated t…

    Codeshipcloudbees.com5 min
  3. FileInputStream / FileOutputStream Considered Harmful

    FileInputStream and FileOutputStream implement finalize, which forces objects onto the finalizer queue and can cause long GC pauses in programs that open many files. Switching to Files.newInputStream and Files.newOutputStream (Java 7+) eliminates the finalizer overhead and improves I/O‑heavy workloads.

    Codeshipcloudbees.com2 min
  4. Textbook review: Is Parallel Programming Hard, And, If So, What Can You Do About It?

    A detailed, personal review of Paul McKenney’s free online textbook on parallel programming. The author, coming from a TLA⁺/distributed‑systems background, finds the early chapters excellent for building intuition about CPU caches, memory ordering, and false‑sharing, but notes gaps (e.g., shallow coverage of C++11 atomics and MESI). The review is concrete, cites specific chapters, and offers prac…

    Lobstersahelwer.ca8 minlobste.rs21