rnpgp / rnp

RNP: high performance C++ OpenPGP library used by Mozilla Thunderbird
https://www.rnpgp.org
Other
202 stars 55 forks source link

s2k_iteration_tuning test failure in 0.17.1 #2289

Closed Apteryks closed 2 weeks ago

Apteryks commented 2 weeks ago

Description

The s2k_iteration_tuning test fails.

Steps to Reproduce

  1. Build from source. Run 'make test'.

Expected Behavior

All test should pass.

Actual Behavior

        Start  15: rnp_tests.s2k_iteration_tuning
 16/263 Test  #15: rnp_tests.s2k_iteration_tuning ................................................***Failed    8.02 sec
[...]
99% tests passed, 1 tests failed out of 263

Total Test time (real) = 212.09 sec

The following tests FAILED:
     15 - rnp_tests.s2k_iteration_tuning (Failed)
Errors while running CTest

The machine used to build/test has a very fast 32 threads processor, if that matters.

ni4 commented 2 weeks ago

Could you please run tests with --output-on-failure or -V passed to the internal ctest call so the test output will be shown? Both fast processor and faketime could make an impact on the test.

Apteryks commented 2 weeks ago

I removed faketime and could still reproduce. The log below is with faketime used, my last try with CTEST_OUTPUT_ON_FAILURE=1 to see the actual error:

        Start  15: rnp_tests.s2k_iteration_tuning
 16/263 Test  #15: rnp_tests.s2k_iteration_tuning ................................................***Failed    8.02 sec
Note: Google Test filter = rnp_tests.s2k_iteration_tuning
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from rnp_tests
[ RUN      ] rnp_tests.s2k_iteration_tuning
s2k iteration tuning ratio: 5.3913, (12058624:65011712)
/tmp/guix-build-rnp-0.17.1.drv-0/source/src/tests/cipher.cpp:625: Failure
Expected: ((ratio)) > ((6)), actual: 5.3913 vs 6
[  FAILED  ] rnp_tests.s2k_iteration_tuning (8014 ms)
[----------] 1 test from rnp_tests (8014 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (8014 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] rnp_tests.s2k_iteration_tuning

 1 FAILED TEST

That's with a Ryzen 9950x processor.

ni4 commented 2 weeks ago

5.39 is almost there :) Just add CXXFLAGS="-DS2K_MINIMUM_TUNING_RATIO=4" in one way or another and tests should pass.

Apteryks commented 2 weeks ago

That resolved it indeed; perhaps the default ratio should be 4 on all platforms?

ni4 commented 2 weeks ago

While we needed 4 only for windows platform in our tests, the ratio is not that critical and could be lowered to avoid possible inconveniences.

Apteryks commented 2 weeks ago

That would probably save a few packagers time (and yours -- thanks a lot for your responsiveness!)