NixOS / NixOS/nixpkgs

tests are flaky if virtualisation.interfaces.enp0s3 is set

Open
#487,520 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0.kind: bug 2.status: stale 6.topic: testing
Dominant language
Nix
Stars
26.2k
Forks
20.1k
PR merge metrics
PR metrics pending

Description

The following flake contains two flaky tests (oftenTimeout and oftenTimeoutSystemdInitrd) and two non-flaky tests (goodUseNetworkd and goodAnotherName). When run multiple times, the two flaky tests often timeout.

Comparing oftenTimeout and goodAnotherName, we find that enp0s3 is flaky but enp1s3 is not, which is quite unexpected and interesting.

# flake.nix
{
  description = "Minimal reproducible example of flaky virtualisation.interfaces.enp0s3";
  # 2026-02-05
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/00c21e4c93d963c50d4c0c89bfa84ed6e0694df2";
  outputs =
    { nixpkgs, self }:
    let
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};
      mkTest =
        interface: useNetworkd: useSystemdInitrd:
        pkgs.testers.runNixOSTest {
          name = "ifname";
          nodes.machine = {
            networking.useNetworkd = useNetworkd;
            boot.initrd.systemd.enable = useSystemdInitrd;
            virtualisation.interfaces.${interface} = {
              vlan = 1;
              assignIP = true;
            };
          };
          testScript = ''machine.wait_for_unit("multi-user.target", timeout=60)'';
        };
    in
    {
      packages.${system} = {
        default = self.packages.${system}.oftenTimeout;
        oftenTimeout = mkTest "enp0s3" false false;
        oftenTimeoutSystemdInitrd = mkTest "enp0s3" false true;
        goodUseNetworkd = mkTest "enp0s3" true false;
        goodAnotherName = mkTest "enp1s3" false false;
      };
    };
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the flake.nix reproducer and run the four packages repeatedly, comparing oftenTimeout and oftenTimeoutSystemdInitrd with goodUseNetworkd and goodAnotherName. Trace the enp0s3 interface setup and test timeouts; done means the flaky tests no longer time out reliably under the reproducer.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.