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
Disable tests_rng on KVM #1275
Comments
|
I wonder if its possible to reproduce that on a Ubuntu based system, shall I try a LXD container with only single core allowed to it ? |
|
another option that sometimes reproduces such issues is running |
|
The other option is to do |
|
I just took a peek at the test code and it seems to be performance based, so my guess is it may not really be getting stuck 'forever' its rather slow to run and depend on the available entropy |
|
ok, I even came with a simple test case I believe the test is bogus and should be disabled. |
|
"forever" was several hours in some cases. Maybe from the fact that there is nothing running in the build VM besides the build job, so that there are no sources of entropy for the kernel to replenish the entropy-pool.
As the code is written atm, it tries to read 10MByte (10000 * 1000) of real entropy while the typical storage on Linux is only ~3000 bits. |
|
I don't understand what that's even supposed to be testing? (It doesn't For now, it could be disabled via a "skip" annotation or renaming it (in case, e.g., someone wants to actually run it some time). @oberstet can you comment on the purpose of this test? "Depleting entropy" isn't really a real thing anyway, AFAIK (according to the cryptographers I respect, anyway), except for the (still interesting!) edge case of "there's actually zero randomness on startup because we're a fresh VM and have zero hardware interrupts happening". |
|
The tests assert test for the number of times the Linux kernel ran into a "entropy depleted" situation due to how exactly the usercode accesses entropy: or "Depleting entropy": we want real entropy .. and to be sure that we use the right code, we test that doing it wrong does not deplete entropy - and hence the entropy is not the one we want. ~ "proof by contradiction." if the machine cannot give us real entropy at some point in time, we want to know that, and wait ourself until there is real entropy again. background: crossbar(fx) wants to use real entropy at certain places - not entropy which is pseudorandomly derived from real entropy (as when reading random bytes via c-lib or via a language run-time). to ensure that we do use the right code in crossbarfx, we first test how we do that from python .. and the helper and test for that have been placed in autobahn. |
no, the test is not bogus;) the itches are likely related to specifics of the virtualization in use and/or the way or throughput with which entropy sources (devices) are exposed within a "guest" ..
|
|
@bmwiedemann not sure if that helps or is what you'd welcome: we could add a guard in the tests and disable this one when running under KVM as long as we keep it running in our Travis CI here
|
|
That could work. And it would probably be a good idea to run the non-depleting test before the depleting one, to still have something left in the pool. |
|
I got a similar issue on an 8-core physical server. As stated on the linked Arch wiki page, haveged might not be appropriate for virtual machines, though. |
|
rgd
I wouldn't use it in production. but we are talking about a CI test anyways .. probably we should do 2 things:
|
|
Could there be an environment variable that disables both depleting and non-depleting tests? if I understand #1275 (comment) correctly, the non-depleting test works correctly only if the depleting test is run first.
Yep I switched to rng-tools later. It also makes the depleting test finish in a few seconds on my physical server. Not sure if it works on virtual machines or not, though, as it uses hardware random number generators. |
|
fixed via #1292 rng depletion tests are now skipped unless an env var in our CI, we do set this env var in tox: https://github.com/crossbario/autobahn-python/blob/master/tox.ini#L80 - that is, the RNG tests are still run on Travis and locally |
While working on reproducible builds for openSUSE, I found that
building our python-autobahn package in a 1-core VM with
gets stuck forever in
test_rng.pyThe text was updated successfully, but these errors were encountered: