rnp icon indicating copy to clipboard operation
rnp copied to clipboard

Remove CFG_USERINPUTFD and use stdin replacement in affected tests.

Open antonsviridenko opened this issue 1 year ago • 10 comments

Closes #1609 and closes #1857

Affected tests now use stdin temporarily replaced with a pipe read end.

antonsviridenko avatar Jun 14 '23 21:06 antonsviridenko

Codecov Report

Patch coverage: 86.53% and project coverage change: +0.64 :tada:

Comparison is base (32149be) 83.81% compared to head (56c28ad) 84.45%.

:exclamation: Current head 56c28ad differs from pull request most recent head d997e6c. Consider uploading reports for the commit d997e6c to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2091      +/-   ##
==========================================
+ Coverage   83.81%   84.45%   +0.64%     
==========================================
  Files         161      143      -18     
  Lines       32395    29147    -3248     
==========================================
- Hits        27151    24617    -2534     
+ Misses       5244     4530     -714     
Impacted Files Coverage Δ
src/lib/crypto/backend_version.cpp 100.00% <ø> (+26.08%) :arrow_up:
src/librekey/g23_sexp.hpp 100.00% <ø> (ø)
src/librepgp/stream-packet.h 100.00% <ø> (ø)
src/tests/support.h 100.00% <ø> (ø)
src/tests/utils-rnpcfg.cpp 100.00% <ø> (ø)
src/librepgp/stream-packet.cpp 80.93% <50.00%> (-0.53%) :arrow_down:
src/tests/generatekey.cpp 89.73% <53.84%> (+1.05%) :arrow_up:
src/lib/rnp.cpp 79.88% <60.00%> (-0.18%) :arrow_down:
src/rnpkeys/tui.cpp 88.51% <85.71%> (+1.15%) :arrow_up:
src/lib/crypto/hash_common.cpp 98.11% <100.00%> (-0.14%) :arrow_down:
... and 8 more

... and 67 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Jun 14 '23 21:06 codecov[bot]

 258/259 Test #248: rnp_tests.test_fuzz_verify ....................................................   Passed    5.99 sec
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
ci/lib/install_functions.inc.sh: line 676:  2438 Aborted                 (core dumped) "$@"
Error: Process completed with exit code 134.

antonsviridenko avatar Jun 16 '23 21:06 antonsviridenko

strange, all of the failing centos-and-fedora instances fail with the same std::bad_alloc error in a place not possibly related to the introduced changes

antonsviridenko avatar Jun 19 '23 16:06 antonsviridenko

@antonsviridenko It could be somehow related to the redirected stdin (and be thrown from GTest side), as other PRs work well.

ni4 avatar Jun 19 '23 19:06 ni4

All failed instances use OpenSSL as a backend...

antonsviridenko avatar Jul 02 '23 12:07 antonsviridenko

Any ideas how to debug this?

ci/lib/install_functions.inc.sh: line 676:  2438 Aborted                 (core dumped) "$@"

Looks like it's something related to Python environment in Centos/Fedora.

antonsviridenko avatar Jul 09 '23 19:07 antonsviridenko

@antonsviridenko Did you try to revert you commits, related to stdio redirection, and see whether that helps?

ni4 avatar Jul 12 '23 13:07 ni4

Did you try to revert you commits, related to stdio redirection, and see whether that helps?

I assume that yes, reverting commits will remove CI failures.

I think it could be related to duplicated STDIN not having CLOEXEC flags... And affected platforms run cli_tests through some python wrapper.

antonsviridenko avatar Jul 16 '23 15:07 antonsviridenko

Is there any possibility to recreate the same local environment as in failing centos-and-fedora machines?

antonsviridenko avatar Jul 20 '23 21:07 antonsviridenko

@antonsviridenko Wow, this one get lost somehow. Locally you may just use corresponding Docker container, install prerequisites, copy rnp sources there, build and run tests. Another option is https://github.com/nektos/act but I didn't try it yet and don't know in which way it works and is it possible to properly debug things.

ni4 avatar Aug 21 '23 08:08 ni4