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

nixos/test/prometheus-exporters/bird: fix race condition #119498

Merged
merged 2 commits into from Apr 24, 2021

Conversation

mweinelt
Copy link
Member

Motivation for this change

https://hydra.nixos.org/build/141423969

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The bird socket would not always be instantly present, when the exporter
was queried, leading to the test sometimes failing in its entirety.
@Ma27
Copy link
Member

Ma27 commented Apr 19, 2021

@mweinelt did the test pass for you? Locally it's hanging with:

bird # [  152.440867] bird_exporter[753]: time="2021-04-19T20:06:34Z" level=error msg="dial unix /var/run/bird.ctl: connect: connection refused" source="metric_collector.go:84"
bird # [  153.456306] bird_exporter[753]: time="2021-04-19T20:06:35Z" level=error msg="dial unix /var/run/bird.ctl: connect: connection refused" source="metric_collector.go:84"
bird # [  154.471430] bird_exporter[753]: time="2021-04-19T20:06:36Z" level=error msg="dial unix /var/run/bird.ctl: connect: connection refused" source="metric_collector.go:84"
bird # [  155.487275] bird_exporter[753]: time="2021-04-19T20:06:37Z" level=error msg="dial unix /var/run/bird.ctl: connect: connection refused" source="metric_collector.go:84"
bird # [  156.502348] bird_exporter[753]: time="2021-04-19T20:06:38Z" level=error msg="dial unix /var/run/bird.ctl: connect: connection refused" source="metric_collector.go:84"

Though I probably wasn't patient enough :)

@mweinelt
Copy link
Member Author

Odd, for me it works. It was racy because the bird socket wouldn't be there yet sometimes.

@Ma27
Copy link
Member

Ma27 commented Apr 23, 2021

@mweinelt how long did the test take for you? As I said, maybe I wasn't patient enough :)

@mweinelt
Copy link
Member Author

nix-build -A nixosTests.prometheus-exporters.bird 1.95s user 0.58s system 11% cpu 21.827 total

@Ma27
Copy link
Member

Ma27 commented Apr 23, 2021

Hmm so way faster than it was the case locally. Let's see what ofborg has to say :)

@ofborg test prometheus-exporters.bird

@mweinelt
Copy link
Member Author

bird # [ 6.428950] bird[682]: Cannot determine router ID, please configure it manually

Previously bird would refuse to start up because the router id wasn't
set.

> bird[682]: Cannot determine router ID, please configure it manually
@mweinelt
Copy link
Member Author

@ofborg test prometheus-exporters.bird

@Ma27 Ma27 merged commit 7b2982e into NixOS:master Apr 24, 2021
@mweinelt mweinelt deleted the tests-bird branch April 24, 2021 19:17
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

2 participants