git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #144872 from hercules-ci/fix-nixosTests-chromium-xclip-blocked
e62c9ceRobert Hensing
nixos/doc/manual/development/writing-nixos-tests.section.md+5−2
@@ -162,7 +162,9 @@ The following methods are available on machine objects:
162 If the command detaches, it must close stdout, as `execute` will wait
162 If the command detaches, it must close stdout, as `execute` will wait
163 for this to consume all output reliably. This can be achieved by
163 for this to consume all output reliably. This can be achieved by
164 redirecting stdout to stderr `>&2`, to `/dev/console`, `/dev/null` or
164 redirecting stdout to stderr `>&2`, to `/dev/console`, `/dev/null` or
165− a file.
165+ a file. Examples of detaching commands are `sleep 365d &`, where the
166+ shell forks a new process that can write to stdout and `xclip -i`, where
167+ the `xclip` command itself forks without closing stdout.
166 Takes an optional parameter `check_return` that defaults to `True`.
168 Takes an optional parameter `check_return` that defaults to `True`.
167 Setting this parameter to `False` will not check for the return code
169 Setting this parameter to `False` will not check for the return code
168 and return -1 instead. This can be used for commands that shut down
170 and return -1 instead. This can be used for commands that shut down
@@ -183,7 +185,8 @@ The following methods are available on machine objects:
183
185
184 - Dereferencing unset variables fail the command.
186 - Dereferencing unset variables fail the command.
185
187
186− - It will wait for stdout to be closed. See `execute`.
188+ - It will wait for stdout to be closed. See `execute` for the
189+ implications.
187
190
188`fail`
191`fail`
189
192
nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml+8−3
@@ -271,8 +271,13 @@ start_all()
271 for this to consume all output reliably. This can be achieved
271 for this to consume all output reliably. This can be achieved
272 by redirecting stdout to stderr <literal>&gt;&amp;2</literal>,
272 by redirecting stdout to stderr <literal>&gt;&amp;2</literal>,
273 to <literal>/dev/console</literal>,
273 to <literal>/dev/console</literal>,
274− <literal>/dev/null</literal> or a file. Takes an optional
274+ <literal>/dev/null</literal> or a file. Examples of detaching
275+ commands are <literal>sleep 365d &amp;</literal>, where the
276+ shell forks a new process that can write to stdout and
277+ <literal>xclip -i</literal>, where the
278+ <literal>xclip</literal> command itself forks without closing
279+ stdout. Takes an optional parameter
275− parameter <literal>check_return</literal> that defaults to
280+ <literal>check_return</literal> that defaults to
276 <literal>True</literal>. Setting this parameter to
281 <literal>True</literal>. Setting this parameter to
277 <literal>False</literal> will not check for the return code
282 <literal>False</literal> will not check for the return code
278 and return -1 instead. This can be used for commands that shut
283 and return -1 instead. This can be used for commands that shut
@@ -314,7 +319,7 @@ start_all()
314 <listitem>
319 <listitem>
315 <para>
320 <para>
316 It will wait for stdout to be closed. See
321 It will wait for stdout to be closed. See
317− <literal>execute</literal>.
322+ <literal>execute</literal> for the implications.
318 </para>
323 </para>
319 </listitem>
324 </listitem>
320 </itemizedlist>
325 </itemizedlist>
nixos/doc/manual/from_md/release-notes/rl-2111.section.xml+4−3
@@ -450,9 +450,10 @@
450 <para>
450 <para>
451 The NixOS VM test framework,
451 The NixOS VM test framework,
452 <literal>pkgs.nixosTest</literal>/<literal>make-test-python.nix</literal>,
452 <literal>pkgs.nixosTest</literal>/<literal>make-test-python.nix</literal>,
453− now requires non-terminating commands such as
453+ now requires detaching commands such as
454− <literal>succeed(&quot;foo &amp;&quot;)</literal> to close
454+ <literal>succeed(&quot;foo &amp;&quot;)</literal> and
455+ <literal>succeed(&quot;foo | xclip -i&quot;)</literal> to
455− stdout. This can be done with a redirect such as
456+ close stdout. This can be done with a redirect such as
456 <literal>succeed(&quot;foo &gt;&amp;2 &amp;&quot;)</literal>.
457 <literal>succeed(&quot;foo &gt;&amp;2 &amp;&quot;)</literal>.
457 This breaking change was necessitated by a race condition
458 This breaking change was necessitated by a race condition
458 causing tests to fail or hang. It applies to all methods that
459 causing tests to fail or hang. It applies to all methods that
nixos/doc/manual/release-notes/rl-2111.section.md+1−1
@@ -133,7 +133,7 @@ In addition to numerous new and upgraded packages, this release has the followin
133
133
134## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
134## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
135
135
136−- The NixOS VM test framework, `pkgs.nixosTest`/`make-test-python.nix`, now requires non-terminating commands such as `succeed("foo &")` to close stdout.
136+- The NixOS VM test framework, `pkgs.nixosTest`/`make-test-python.nix`, now requires detaching commands such as `succeed("foo &")` and `succeed("foo | xclip -i")` to close stdout.
137 This can be done with a redirect such as `succeed("foo >&2 &")`. This breaking change was necessitated by a race condition causing tests to fail or hang.
137 This can be done with a redirect such as `succeed("foo >&2 &")`. This breaking change was necessitated by a race condition causing tests to fail or hang.
138 It applies to all methods that invoke commands on the nodes, including `execute`, `succeed`, `fail`, `wait_until_succeeds`, `wait_until_fails`.
138 It applies to all methods that invoke commands on the nodes, including `execute`, `succeed`, `fail`, `wait_until_succeeds`, `wait_until_fails`.
139
139
nixos/tests/chromium.nix+1−1
@@ -215,7 +215,7 @@ mapAttrs (channel: chromiumPkg: makeTest rec {
215
215
216 clipboard = machine.succeed(
216 clipboard = machine.succeed(
217 ru(
217 ru(
218− "echo void | ${pkgs.xclip}/bin/xclip -i"
218+ "echo void | ${pkgs.xclip}/bin/xclip -i >&2"
219 )
219 )
220 )
220 )
221 machine.succeed(
221 machine.succeed(