fix: let the unity_tester fixture accept emulator duts (CII-249) - #430
Conversation
The fixture yielded twice when a dut was not an `IdfDut`, so every case using it errored under `--embedded-services idf,espemu` or `idf,qemu`. Accept any dut carrying `IdfUnityDutMixin`, which is what `CaseTester` actually needs.
|
@hfudev Could you PTAL? |
unity_tester fixture accept emulator dutsunity_tester fixture accept emulator duts (CII-249)
|
Hi @Harshal5 the fix in general makes sense. but now this test case is failing constantly (after i retried once) ERROR test_expect_unity_test_ouput.py::test_expect_unity_test_output_basic - RuntimeError: Failed to process thread exception could you help check the error? |
test_expect_from_timeout left a daemon thread writing for 7.5s while the test returned after 4s, so it wrote into a torn-down queue and raised BrokenPipeError after the session. pytest reported that against whichever test ran next.
Thanks for looking. I dug into that error using an AI agent and I don't think it comes from this change. IssueThe reported message is the tail of a chained exception; the cause in the job log is:
Why CI sees it and a plain local run doesn'tWithout coverage the run finishes before the pipe is gone. With FixI've pushed a commit that stops the writer thread with the test that starts it (a |
|
thank you! will release next Monday |
Description
Every test using the
unity_testerfixture errors out under--embedded-services idf,espemuor--embedded-services idf,qemu:Two separate bugs in the same fixture:
yield Nonesits inside theforloop, so it does not end the generator, execution continues toyield CaseTester()and pytest rejects the fixture.isinstance(_dut, IdfDut)can never hold for an emulator dut:IdfDut(IdfUnityDutMixin, SerialDut)is serial based, sodut_factory.pypicksEspEmuDut/QemuDutinstead. But the factory deliberately mixesIdfUnityDutMixininto those duts when theidfservice is used (dut_factory.py:393), and that mixin is allCaseTesterneeds, it drivesdut.test_menu, not anything serial specific.Because ESP-IDF's root
conftest.pywraps this fixture:so every ESP-IDF test taking
case_testeris unrunnable on either emulator.Fix
Yield exactly once per path, and accept any dut that carries the mixing CaseTester relies on:
IdfDutstill satisfies the check, since it inheritsIdfUnityDutMixin, thus, no change for serial runs.Checklist
Before submitting a Pull Request, please ensure the following: