Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix evaluation of two tests #44870

Merged
merged 2 commits into from Aug 10, 2018
Merged

Fix evaluation of two tests #44870

merged 2 commits into from Aug 10, 2018

Conversation

symphorien
Copy link
Member

Motivation for this change

Fix evaluation of two tests.
yabar builds fine now, but not hocker fetchdocker.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Aug 10, 2018

cc @Ma27

@@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, lib }:
import ./make-test.nix ({ pkgs, lib, system }:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add system ? builtins.currentSystem here? Many tests do this, it makes them easier to run standalone (without release.nix).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system is not even used in the test so I replaced it with ...

@xeji
Copy link
Contributor

xeji commented Aug 10, 2018

@GrahamcOfBorg test yabar

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: tests.yabar

Partial log (click to expand)

yabar# [   37.004292] su[867]: pam_unix(su:session): session closed for user bob
yabar: exit status 0
error: unit ‘yabar.service’ reached state ‘failed’
unit ‘yabar.service’ reached state ‘failed’
cleaning up
killing yabar (pid 597)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
builder for '/nix/store/si42p2kxy0mncfh13s6hhsm1ji9n9bqc-vm-test-run-yabar.drv' failed with exit code 255
error: build of '/nix/store/si42p2kxy0mncfh13s6hhsm1ji9n9bqc-vm-test-run-yabar.drv' failed

@symphorien
Copy link
Member Author

Apparently waitForUnit inferferes with systemd's restarting the service. When lucky, the unit is restarted exactly when the perl script checks that the unit is alive: here is a successful run of the test:

yabar# [   19.885106] systemd[801]: Startup finished in 118ms.
yabar# [   20.461154] systemd[801]: Started yabar service.
yabar# [   20.462729] systemd[801]: Reached target Current graphical user session.
yabar# [   20.747167] yabar-start[857]: Please add at least one bar in the `bar-list` entry.
yabar# [   20.748808] yabar-start[857]: Exiting...
yabar: running command: journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'Reached target Current graphical'
yabar: exit status 0
yabar: running command: [ -e /tmp/.X11-unix/X0 ]
yabar: exit status 0
yabar: waiting for unit ‘yabar.service’
yabar: running command: su -l bob -c $'XDG_RUNTIME_DIR=/run/user/`id -u` systemctl --user --no-pager show "yabar.service"'
yabar# [   20.935626] su[865]: Successful su for bob by root
yabar# [   20.939550] su[865]: pam_unix(su:session): session opened for user bob by (uid=0)
yabar# [   21.115810] systemd[801]: yabar.service: Service hold-off time over, scheduling restart.
yabar# [   21.119296] systemd[801]: yabar.service: Scheduled restart job, restart counter is at 1.
yabar# [   21.127598] systemd[801]: Stopped yabar service.
yabar# [   21.133216] systemd[801]: Started yabar service.
yabar# [   21.190359] su[865]: pam_unix(su:session): session closed for user bob
yabar: exit status 0
collecting coverage data
yabar: running command: test -e /sys/kernel/debug/gcov
yabar: exit status 1
syncing
yabar: running command: sync
yabar# [   21.210457] yabar-start[879]: Please add at least one bar in the `bar-list` entry.
yabar# [   21.212935] yabar-start[879]: Exiting...
yabar: exit status 0
test script finished in 29.10s
cleaning up
killing yabar (pid 600)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty

Anyway, my goal is just that they evaluate.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.yabar

Partial log (click to expand)

yabar: exit status 1
syncing
yabar: running command: sync
yabar: exit status 0
test script finished in 35.02s
cleaning up
killing yabar (pid 631)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/q09bh05k5wl2bl3cz614zvh1aipg690h-vm-test-run-yabar

@xeji
Copy link
Contributor

xeji commented Aug 10, 2018

Anyway, my goal is just that they evaluate.

Fair enough, so let's merge this now and fix test failures separately.

@xeji xeji merged commit 12eb1e9 into NixOS:master Aug 10, 2018
@Ma27
Copy link
Member

Ma27 commented Aug 10, 2018

Thanks for fixing this! I'm sorry for the extra work, I just tested it with nix-build ./nixos/tests/$test.nix, but not from release.nix :/

@xeji
Copy link
Contributor

xeji commented Aug 10, 2018

@Ma27 could you have a look at the non-deterministic failure of the yabar test when you find the time? Not urgent but should be fixed eventually...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants