nutshell icon indicating copy to clipboard operation
nutshell copied to clipboard

[Tests] test_wallet.py fails on main

Open wfjvdham opened this issue 1 year ago • 2 comments

When pulling the main branch and running tests like described in the README I get the following error:

tests/test_wallet.py:373: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

f = <_GatheringFuture finished exception=Exception('Mint Error: Token already spent. (Code: 11001)')>
msg = 'proofs are pending.'

    async def assert_err(f, msg: Union[str, CashuError]):
        """Compute f() and expect an error message 'msg'."""
        try:
            await f
        except Exception as exc:
            error_message: str = str(exc.args[0])
            if isinstance(msg, CashuError):
                if msg.detail not in error_message:
                    raise Exception(
                        f"CashuError. Expected error: {msg.detail}, got: {error_message}"
                    )
                return
            if msg not in error_message:
>               raise Exception(f"Expected error: {msg}, got: {error_message}")
E               Exception: Expected error: proofs are pending., got: Mint Error: Token already spent. (Code: 11001)

tests/test_wallet.py:38: Exception

wfjvdham avatar Apr 11 '24 09:04 wfjvdham

Which test is this? If this is the test for the race condition, then this is a known issue (which I don't know how to fix yet). It "works on my computer" but I noticed it fails on others (probably slower computers?).

Please feel free to PR a fix that ignores this test or treats it as "ok to fail" if it is the race condition test.

callebtc avatar Apr 11 '24 11:04 callebtc

Yes it is the test_split_race_condition test. I will try to fix it and otherwise ignore it. Thanks!

wfjvdham avatar Apr 11 '24 12:04 wfjvdham