nix-eval-jobs-functional-tests
default.checks.aarch64-darwin.functional-tests
· build #48
· raw
1============================= test session starts ==============================2platform darwin -- Python 3.13.9, pytest-8.4.2, pluggy-1.6.0 -- /nix/store/xcjk9ill54kjk8mzgq6yydnx9015lidg-python3-3.13.9/bin/python3.133cachedir: .pytest_cache4rootdir: /nix/var/nix/builds/nix-49230-33616553615collected 23 items 67tests-functional/test_eval.py::test_flake PASSED [ 4%]8tests-functional/test_eval.py::test_query_cache_status PASSED [ 8%]9tests-functional/test_eval.py::test_expression PASSED [ 13%]10tests-functional/test_eval.py::test_input_drvs PASSED [ 17%]11tests-functional/test_eval.py::test_eval_error PASSED [ 21%]12tests-functional/test_eval.py::test_no_gcroot_dir PASSED [ 26%]13tests-functional/test_eval.py::test_daemon_only_settings_do_not_warn PASSED [ 30%]14tests-functional/test_eval.py::test_constituents PASSED [ 34%]15tests-functional/test_eval.py::test_constituents_all PASSED [ 39%]16tests-functional/test_eval.py::test_constituents_glob_misc PASSED [ 43%]17tests-functional/test_eval.py::test_constituents_cycle PASSED [ 47%]18tests-functional/test_eval.py::test_constituents_error PASSED [ 52%]19tests-functional/test_eval.py::test_empty_needed PASSED [ 56%]20tests-functional/test_eval.py::test_apply PASSED [ 60%]21tests-functional/test_eval.py::test_select_flake PASSED [ 65%]22tests-functional/test_eval.py::test_recursion_error PASSED [ 69%]23tests-functional/test_eval.py::test_no_instantiate_mode PASSED [ 73%]24tests-functional/test_eval.py::test_fod_with_uncached_input_issue413[file] PASSED [ 78%]25tests-functional/test_eval.py::test_fod_with_uncached_input_issue413[http] PASSED [ 82%]26tests-functional/test_eval.py::test_worker_log_format_survives_fork PASSED [ 86%]27tests-functional/test_eval.py::test_worker_restart_on_last_job_exits_cleanly PASSED [ 91%]28tests-functional/test_eval.py::test_fetchers_survive_worker_restart PASSED [ 95%]29tests-functional/test_eval.py::test_workers_do_not_race_flake_fetch FAILED [100%]3031=================================== FAILURES ===================================32_____________________ test_workers_do_not_race_flake_fetch _____________________3334tmp_path = PosixPath('/nix/var/nix/builds/nix-49230-3361655361/pytest-of-_nixbld1/pytest-0/test_workers_do_not_race_flake0')3536 def test_workers_do_not_race_flake_fetch(tmp_path: Path) -> None:37 """Workers fetching the same flake input concurrently spam "waiting38 for another Nix process to finish fetching input" (issue #432)."""39 env = _hermetic_nix_env(tmp_path)40 repo = tmp_path / "flake"41 repo.mkdir()42 jobs = "\n".join(43 f"""44 job-{i} = derivation {{45 name = "race-{i}";46 system = "x86_64-linux";47 builder = "/bin/sh";48 args = [ "-c" "echo {i} > $out" ]; }};"""49 for i in range(8)50 )51 repo.joinpath("flake.nix").write_text(f"{{ outputs = _: {{ hydraJobs = {{ {jobs} }}; }}; }}")52> subprocess.run(["git", "init", "-q"], cwd=repo, check=True, env=env)5354tests-functional/test_eval.py:875: 55_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 56/nix/store/xcjk9ill54kjk8mzgq6yydnx9015lidg-python3-3.13.9/lib/python3.13/subprocess.py:554: in run57 with Popen(*popenargs, **kwargs) as process:58 ^^^^^^^^^^^^^^^^^^^^^^^^^^^59/nix/store/xcjk9ill54kjk8mzgq6yydnx9015lidg-python3-3.13.9/lib/python3.13/subprocess.py:1039: in __init__60 self._execute_child(args, executable, preexec_fn, close_fds,61_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 6263self = <Popen: returncode: 255 args: ['git', 'init', '-q']>64args = ['git', 'init', '-q'], executable = b'git', preexec_fn = None65close_fds = True, pass_fds = ()66cwd = PosixPath('/nix/var/nix/builds/nix-49230-3361655361/pytest-of-_nixbld1/pytest-0/test_workers_do_not_race_flake0/flake')67env = {'CONFIG_SHELL': '/nix/store/p0k9r5h8qs7220xdbdihhfgzwjcly70x-bash-5.3p3/bin/bash', 'DETERMINISTIC_BUILD': '1', 'GZIP_...OME': '/nix/var/nix/builds/nix-49230-3361655361/pytest-of-_nixbld1/pytest-0/test_workers_do_not_race_flake0/home', ...}68startupinfo = None, creationflags = 0, shell = False, p2cread = -169p2cwrite = -1, c2pread = -1, c2pwrite = -1, errread = -1, errwrite = -170restore_signals = True, gid = None, gids = None, uid = None, umask = -171start_new_session = False, process_group = -17273 def _execute_child(self, args, executable, preexec_fn, close_fds,74 pass_fds, cwd, env,75 startupinfo, creationflags, shell,76 p2cread, p2cwrite,77 c2pread, c2pwrite,78 errread, errwrite,79 restore_signals,80 gid, gids, uid, umask,81 start_new_session, process_group):82 """Execute program (POSIX version)"""83 84 if isinstance(args, (str, bytes)):85 args = [args]86 elif isinstance(args, os.PathLike):87 if shell:88 raise TypeError('path-like args is not allowed when '89 'shell is true')90 args = [args]91 else:92 args = list(args)93 94 if shell:95 # On Android the default shell is at '/system/bin/sh'.96 unix_shell = ('/system/bin/sh' if97 hasattr(sys, 'getandroidapilevel') else '/nix/store/p0k9r5h8qs7220xdbdihhfgzwjcly70x-bash-5.3p3/bin/sh')98 args = [unix_shell, "-c"] + args99 if executable:100 args[0] = executable101 102 if executable is None:103 executable = args[0]104 105 sys.audit("subprocess.Popen", executable, args, cwd, env)106 107 if (_USE_POSIX_SPAWN108 and os.path.dirname(executable)109 and preexec_fn is None110 and (not close_fds or _HAVE_POSIX_SPAWN_CLOSEFROM)111 and not pass_fds112 and cwd is None113 and (p2cread == -1 or p2cread > 2)114 and (c2pwrite == -1 or c2pwrite > 2)115 and (errwrite == -1 or errwrite > 2)116 and not start_new_session117 and process_group == -1118 and gid is None119 and gids is None120 and uid is None121 and umask < 0):122 self._posix_spawn(args, executable, env, restore_signals, close_fds,123 p2cread, p2cwrite,124 c2pread, c2pwrite,125 errread, errwrite)126 return127 128 orig_executable = executable129 130 # For transferring possible exec failure from child to parent.131 # Data format: "exception name:hex errno:description"132 # Pickle is not used; it is complex and involves memory allocation.133 errpipe_read, errpipe_write = os.pipe()134 # errpipe_write must not be in the standard io 0, 1, or 2 fd range.135 low_fds_to_close = []136 while errpipe_write < 3:137 low_fds_to_close.append(errpipe_write)138 errpipe_write = os.dup(errpipe_write)139 for low_fd in low_fds_to_close:140 os.close(low_fd)141 try:142 try:143 # We must avoid complex work that could involve144 # malloc or free in the child process to avoid145 # potential deadlocks, thus we do all this here.146 # and pass it to fork_exec()147 148 if env is not None:149 env_list = []150 for k, v in env.items():151 k = os.fsencode(k)152 if b'=' in k:153 raise ValueError("illegal environment variable name")154 env_list.append(k + b'=' + os.fsencode(v))155 else:156 env_list = None # Use execv instead of execve.157 executable = os.fsencode(executable)158 if os.path.dirname(executable):159 executable_list = (executable,)160 else:161 # This matches the behavior of os._execvpe().162 executable_list = tuple(163 os.path.join(os.fsencode(dir), executable)164 for dir in os.get_exec_path(env))165 fds_to_keep = set(pass_fds)166 fds_to_keep.add(errpipe_write)167 self.pid = _fork_exec(168 args, executable_list,169 close_fds, tuple(sorted(map(int, fds_to_keep))),170 cwd, env_list,171 p2cread, p2cwrite, c2pread, c2pwrite,172 errread, errwrite,173 errpipe_read, errpipe_write,174 restore_signals, start_new_session,175 process_group, gid, gids, uid, umask,176 preexec_fn, _USE_VFORK)177 self._child_created = True178 finally:179 # be sure the FD is closed no matter what180 os.close(errpipe_write)181 182 self._close_pipe_fds(p2cread, p2cwrite,183 c2pread, c2pwrite,184 errread, errwrite)185 186 # Wait for exec to fail or succeed; possibly raising an187 # exception (limited in size)188 errpipe_data = bytearray()189 while True:190 part = os.read(errpipe_read, 50000)191 errpipe_data += part192 if not part or len(errpipe_data) > 50000:193 break194 finally:195 # be sure the FD is closed no matter what196 os.close(errpipe_read)197 198 if errpipe_data:199 try:200 pid, sts = os.waitpid(self.pid, 0)201 if pid == self.pid:202 self._handle_exitstatus(sts)203 else:204 self.returncode = sys.maxsize205 except ChildProcessError:206 pass207 208 try:209 exception_name, hex_errno, err_msg = (210 errpipe_data.split(b':', 2))211 # The encoding here should match the encoding212 # written in by the subprocess implementations213 # like _posixsubprocess214 err_msg = err_msg.decode()215 except ValueError:216 exception_name = b'SubprocessError'217 hex_errno = b'0'218 err_msg = 'Bad exception data from child: {!r}'.format(219 bytes(errpipe_data))220 child_exception_type = getattr(221 builtins, exception_name.decode('ascii'),222 SubprocessError)223 if issubclass(child_exception_type, OSError) and hex_errno:224 errno_num = int(hex_errno, 16)225 if err_msg == "noexec:chdir":226 err_msg = ""227 # The error must be from chdir(cwd).228 err_filename = cwd229 elif err_msg == "noexec":230 err_msg = ""231 err_filename = None232 else:233 err_filename = orig_executable234 if errno_num != 0:235 err_msg = os.strerror(errno_num)236 if err_filename is not None:237> raise child_exception_type(errno_num, err_msg, err_filename)238E FileNotFoundError: [Errno 2] No such file or directory: 'git'239240/nix/store/xcjk9ill54kjk8mzgq6yydnx9015lidg-python3-3.13.9/lib/python3.13/subprocess.py:1972: FileNotFoundError241=========================== short test summary info ============================242FAILED tests-functional/test_eval.py::test_workers_do_not_race_flake_fetch - FileNotFoundError: [Errno 2] No such file or directory: 'git'243========================= 1 failed, 22 passed in 4.19s =========================