Repository: borgbackup/borg

Issue:
borg 2.0.0b8 `benchmark cpu` errors in `assert rc is None`
Looks like there is an issue with the `borg benchmark cpu` command in borg 2.0.0b8. It errors after the msgpack tests are completed. 

I tried setting `BORG_EXIT_CODES=modern` to see if it makes any difference, but it didn't change anything.

The log below is from a local build, but it also reproduces with the borg binary releases.

```bash
$ borg benchmark cpu --debug --show-rc
using builtin fallback logging configuration
33 self tests completed in 0.07 seconds
Chunkers =======================================================
buzhash,19,23,21,4095    1GB        0.557s
fixed,1048576            1GB        0.026s
Non-cryptographic checksums / hashes ===========================
xxh64                    1GB        0.073s
crc32 (zlib)             1GB        0.556s
Cryptographic hashes / MACs ====================================
hmac-sha256              1GB        0.427s
blake2b-256              1GB        1.179s
Encryption =====================================================
aes-256-ctr-hmac-sha256  1GB        0.613s
aes-256-ctr-blake2b      1GB        1.668s
aes-256-ocb              1GB        0.151s
chacha20-poly1305        1GB        0.353s
KDFs (slow is GOOD, use argon2!) ===============================
pbkdf2                   5          0.091s
argon2                   5          0.150s
Compression ====================================================
lz4          0.1GB      0.006s
zstd,1       0.1GB      0.033s
zstd,3       0.1GB      0.037s
zstd,5       0.1GB      0.167s
zstd,10      0.1GB      0.195s
zstd,16      0.1GB      3.694s
zstd,22      0.1GB      5.901s
zlib,0       0.1GB      0.036s
zlib,6       0.1GB      1.889s
zlib,9       0.1GB      1.943s
lzma,0       0.1GB      10.402s
lzma,6       0.1GB      15.927s
lzma,9       0.1GB      14.918s
msgpack ========================================================
msgpack      100k Items 0.064s
Local Exception

Error:

AssertionError: 

If reporting bugs, please include the following:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/borg/archiver/__init__.py", line 656, in main
    exit_code = archiver.run(args)
                ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/borg/archiver/__init__.py", line 550, in run
    assert rc is None
           ^^^^^^^^^^
AssertionError

Platform: Linux 23d75cdbfd59 6.7.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 17 Feb 2024 14:02:33 +0000 x86_64
Linux: Unknown Linux  
Borg: 2.0.0b8  Python: CPython 3.11.8 msgpack: 1.0.7 fuse: None [none]
PID: 1  CWD: /
sys.argv: ['/usr/local/bin/borg', 'benchmark', 'cpu', '--debug', '--show-rc']
SSH_ORIGINAL_COMMAND: None


terminating with error status, rc 2
```


Discussion:

Resolving patch:
diff --git a/src/borg/archiver/benchmark_cmd.py b/src/borg/archiver/benchmark_cmd.py
--- a/src/borg/archiver/benchmark_cmd.py
+++ b/src/borg/archiver/benchmark_cmd.py
@@ -226,8 +226,6 @@ def chunkit(chunker_name, *args, **kwargs):
         spec = "msgpack"
         print(f"{spec:<12} {size:<10} {timeit(lambda: msgpack.packb(items), number=100):.3f}s")
 
-        return 0
-
     def build_parser_benchmarks(self, subparsers, common_parser, mid_common_parser):
         from ._common import process_epilog
 


Test patch: