nix-eval-jobs-functional-tests
default.checks.x86_64-linux.functional-tests
· build #48
· raw
1tribuchet: building on jamie2============================= test session starts ==============================3platform linux -- Python 3.13.9, pytest-8.4.2, pluggy-1.6.0 -- /nix/store/3lll9y925zz9393sa59h653xik66srjb-python3-3.13.9/bin/python3.134cachedir: .pytest_cache5rootdir: /build6collecting ... collected 23 items78tests-functional/test_eval.py::test_flake PASSED [ 4%]9tests-functional/test_eval.py::test_query_cache_status PASSED [ 8%]10tests-functional/test_eval.py::test_expression PASSED [ 13%]11tests-functional/test_eval.py::test_input_drvs PASSED [ 17%]12tests-functional/test_eval.py::test_eval_error PASSED [ 21%]13tests-functional/test_eval.py::test_no_gcroot_dir PASSED [ 26%]14tests-functional/test_eval.py::test_daemon_only_settings_do_not_warn PASSED [ 30%]15tests-functional/test_eval.py::test_constituents PASSED [ 34%]16tests-functional/test_eval.py::test_constituents_all PASSED [ 39%]17tests-functional/test_eval.py::test_constituents_glob_misc PASSED [ 43%]18tests-functional/test_eval.py::test_constituents_cycle PASSED [ 47%]19tests-functional/test_eval.py::test_constituents_error PASSED [ 52%]20tests-functional/test_eval.py::test_empty_needed PASSED [ 56%]21tests-functional/test_eval.py::test_apply PASSED [ 60%]22tests-functional/test_eval.py::test_select_flake PASSED [ 65%]23tests-functional/test_eval.py::test_recursion_error PASSED [ 69%]24tests-functional/test_eval.py::test_no_instantiate_mode PASSED [ 73%]25tests-functional/test_eval.py::test_fod_with_uncached_input_issue413[file] PASSED [ 78%]26tests-functional/test_eval.py::test_fod_with_uncached_input_issue413[http] PASSED [ 82%]27tests-functional/test_eval.py::test_worker_log_format_survives_fork PASSED [ 86%]28tests-functional/test_eval.py::test_worker_restart_on_last_job_exits_cleanly PASSED [ 91%]29tests-functional/test_eval.py::test_fetchers_survive_worker_restart PASSED [ 95%]30tests-functional/test_eval.py::test_workers_do_not_race_flake_fetch FAILED [100%]3132=================================== FAILURES ===================================33_____________________ test_workers_do_not_race_flake_fetch _____________________3435tmp_path = PosixPath('/build/pytest-of-nixbld/pytest-0/test_workers_do_not_race_flake0')3637 def test_workers_do_not_race_flake_fetch(tmp_path: Path) -> None:38 """Workers fetching the same flake input concurrently spam "waiting39 for another Nix process to finish fetching input" (issue #432)."""40 env = _hermetic_nix_env(tmp_path)41 repo = tmp_path / "flake"42 repo.mkdir()43 jobs = "\n".join(44 f"""45 job-{i} = derivation {{46 name = "race-{i}";47 system = "x86_64-linux";48 builder = "/bin/sh";49 args = [ "-c" "echo {i} > $out" ]; }};"""50 for i in range(8)51 )52 repo.joinpath("flake.nix").write_text(f"{{ outputs = _: {{ hydraJobs = {{ {jobs} }}; }}; }}")53> subprocess.run(["git", "init", "-q"], cwd=repo, check=True, env=env)5455tests-functional/test_eval.py:875: 56_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 57/nix/store/3lll9y925zz9393sa59h653xik66srjb-python3-3.13.9/lib/python3.13/subprocess.py:554: in run58 with Popen(*popenargs, **kwargs) as process:59 ^^^^^^^^^^^^^^^^^^^^^^^^^^^60/nix/store/3lll9y925zz9393sa59h653xik66srjb-python3-3.13.9/lib/python3.13/subprocess.py:1039: in __init__61 self._execute_child(args, executable, preexec_fn, close_fds,62_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 6364self = <Popen: returncode: 255 args: ['git', 'init', '-q']>65args = ['git', 'init', '-q'], executable = b'git', preexec_fn = None66close_fds = True, pass_fds = ()67cwd = PosixPath('/build/pytest-of-nixbld/pytest-0/test_workers_do_not_race_flake0/flake')68env = {'CONFIG_SHELL': '/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/bash', 'DETERMINISTIC_BUILD': '1', 'GZIP_NO_TIMESTAMPS': '1', 'HOME': '/build/pytest-of-nixbld/pytest-0/test_workers_do_not_race_flake0/home', ...}69startupinfo = None, creationflags = 0, shell = False, p2cread = -170p2cwrite = -1, c2pread = -1, c2pwrite = -1, errread = -1, errwrite = -171restore_signals = True, gid = None, gids = None, uid = None, umask = -172start_new_session = False, process_group = -17374 def _execute_child(self, args, executable, preexec_fn, close_fds,75 pass_fds, cwd, env,76 startupinfo, creationflags, shell,77 p2cread, p2cwrite,78 c2pread, c2pwrite,79 errread, errwrite,80 restore_signals,81 gid, gids, uid, umask,82 start_new_session, process_group):83 """Execute program (POSIX version)"""84 85 if isinstance(args, (str, bytes)):86 args = [args]87 elif isinstance(args, os.PathLike):88 if shell:89 raise TypeError('path-like args is not allowed when '90 'shell is true')91 args = [args]92 else:93 args = list(args)94 95 if shell:96 # On Android the default shell is at '/system/bin/sh'.97 unix_shell = ('/system/bin/sh' if98 hasattr(sys, 'getandroidapilevel') else '/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh')99 args = [unix_shell, "-c"] + args100 if executable:101 args[0] = executable102 103 if executable is None:104 executable = args[0]105 106 sys.audit("subprocess.Popen", executable, args, cwd, env)107 108 if (_USE_POSIX_SPAWN109 and os.path.dirname(executable)110 and preexec_fn is None111 and (not close_fds or _HAVE_POSIX_SPAWN_CLOSEFROM)112 and not pass_fds113 and cwd is None114 and (p2cread == -1 or p2cread > 2)115 and (c2pwrite == -1 or c2pwrite > 2)116 and (errwrite == -1 or errwrite > 2)117 and not start_new_session118 and process_group == -1119 and gid is None120 and gids is None121 and uid is None122 and umask < 0):123 self._posix_spawn(args, executable, env, restore_signals, close_fds,124 p2cread, p2cwrite,125 c2pread, c2pwrite,126 errread, errwrite)127 return128 129 orig_executable = executable130 131 # For transferring possible exec failure from child to parent.132 # Data format: "exception name:hex errno:description"133 # Pickle is not used; it is complex and involves memory allocation.134 errpipe_read, errpipe_write = os.pipe()135 # errpipe_write must not be in the standard io 0, 1, or 2 fd range.136 low_fds_to_close = []137 while errpipe_write < 3:138 low_fds_to_close.append(errpipe_write)139 errpipe_write = os.dup(errpipe_write)140 for low_fd in low_fds_to_close:141 os.close(low_fd)142 try:143 try:144 # We must avoid complex work that could involve145 # malloc or free in the child process to avoid146 # potential deadlocks, thus we do all this here.147 # and pass it to fork_exec()148 149 if env is not None:150 env_list = []151 for k, v in env.items():152 k = os.fsencode(k)153 if b'=' in k:154 raise ValueError("illegal environment variable name")155 env_list.append(k + b'=' + os.fsencode(v))156 else:157 env_list = None # Use execv instead of execve.158 executable = os.fsencode(executable)159 if os.path.dirname(executable):160 executable_list = (executable,)161 else:162 # This matches the behavior of os._execvpe().163 executable_list = tuple(164 os.path.join(os.fsencode(dir), executable)165 for dir in os.get_exec_path(env))166 fds_to_keep = set(pass_fds)167 fds_to_keep.add(errpipe_write)168 self.pid = _fork_exec(169 args, executable_list,170 close_fds, tuple(sorted(map(int, fds_to_keep))),171 cwd, env_list,172 p2cread, p2cwrite, c2pread, c2pwrite,173 errread, errwrite,174 errpipe_read, errpipe_write,175 restore_signals, start_new_session,176 process_group, gid, gids, uid, umask,177 preexec_fn, _USE_VFORK)178 self._child_created = True179 finally:180 # be sure the FD is closed no matter what181 os.close(errpipe_write)182 183 self._close_pipe_fds(p2cread, p2cwrite,184 c2pread, c2pwrite,185 errread, errwrite)186 187 # Wait for exec to fail or succeed; possibly raising an188 # exception (limited in size)189 errpipe_data = bytearray()190 while True:191 part = os.read(errpipe_read, 50000)192 errpipe_data += part193 if not part or len(errpipe_data) > 50000:194 break195 finally:196 # be sure the FD is closed no matter what197 os.close(errpipe_read)198 199 if errpipe_data:200 try:201 pid, sts = os.waitpid(self.pid, 0)202 if pid == self.pid:203 self._handle_exitstatus(sts)204 else:205 self.returncode = sys.maxsize206 except ChildProcessError:207 pass208 209 try:210 exception_name, hex_errno, err_msg = (211 errpipe_data.split(b':', 2))212 # The encoding here should match the encoding213 # written in by the subprocess implementations214 # like _posixsubprocess215 err_msg = err_msg.decode()216 except ValueError:217 exception_name = b'SubprocessError'218 hex_errno = b'0'219 err_msg = 'Bad exception data from child: {!r}'.format(220 bytes(errpipe_data))221 child_exception_type = getattr(222 builtins, exception_name.decode('ascii'),223 SubprocessError)224 if issubclass(child_exception_type, OSError) and hex_errno:225 errno_num = int(hex_errno, 16)226 if err_msg == "noexec:chdir":227 err_msg = ""228 # The error must be from chdir(cwd).229 err_filename = cwd230 elif err_msg == "noexec":231 err_msg = ""232 err_filename = None233 else:234 err_filename = orig_executable235 if errno_num != 0:236 err_msg = os.strerror(errno_num)237 if err_filename is not None:238> raise child_exception_type(errno_num, err_msg, err_filename)239E FileNotFoundError: [Errno 2] No such file or directory: 'git'240241/nix/store/3lll9y925zz9393sa59h653xik66srjb-python3-3.13.9/lib/python3.13/subprocess.py:1972: FileNotFoundError242=========================== short test summary info ============================243FAILED tests-functional/test_eval.py::test_workers_do_not_race_flake_fetch - ...244========================= 1 failed, 22 passed in 4.77s =========================