diff mbox series

oeqa/reproducibility: Work around subunit protocol limitations/bugs

Message ID 20260409203526.3540882-1-richard.purdie@linuxfoundation.org
State New
Headers show
Series oeqa/reproducibility: Work around subunit protocol limitations/bugs | expand

Commit Message

Richard Purdie April 9, 2026, 8:35 p.m. UTC
We've seen reproducibility failures with:

  File "/usr/lib/python3/dist-packages/subunit/chunked.py", line 108, in _read_length
    raise ValueError("chunk header invalid: %r" % count_str)
ValueError: chunk header invalid: b'\n'

which leads to:

2026-04-09 01:18:20,886 - oe-selftest - INFO - ERROR: broken-runner

and UNKNOWN status for builds queued in that runner.

This appears to be when reproducibility builds fail with:

Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/bringup-fast/build/layers/openembedded-core/meta/lib/oeqa/selftest/cases/reproducible.py", line 407, in test_reproducible_builds
    self.fail('\n'.join(fails))
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.14/unittest/case.py", line 750, in fail
    raise self.failureException(msg)

which is possibly from bad placement of '\n' in the byte stream. It doesn't
100% reproduce since the placement is critical but from the subunit code, it
does use <int>\n as a header in the protocol.

I've wondered if the presence of "\n" in the traceback code is part of the issue
so remove "\n" from the traceback by writing the python code differently just in
case it helps.

Ideally we'd report the issue and fix subunit but I was unable to work out the
exact sequence to reproduce and any fix would take time to propogate anyway.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/reproducible.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py
index 7adeaacd4f5..9ed7dec591a 100644
--- a/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -404,5 +404,6 @@  class ReproducibleTests(OESelftestTestCase):
                         native_sysroot=diffoscope_sysroot, ignore_status=True, cwd=package_dir)
 
         if fails:
-            self.fail('\n'.join(fails))
+            failmsg = '\n'.join(fails)
+            self.fail(failmsg)