elements icon indicating copy to clipboard operation
elements copied to clipboard

Intermittent stall in unit tests

Open apoelstra opened this issue 4 years ago • 1 comments

There is a race condition where we wind up enabling dynafed globally when running all the unit tests. Then in the TestChain100Setup (used by most of the wallet tests, for example), try to PoW up a bunch of blocks, in the line https://github.com/ElementsProject/elements/blob/88067ddbe4223e43a4c86912928b28b834bbf69e/src/test/test_bitcoin.cpp#L168 which will just run forever. In dynafed nNonce doesn't go into the hash.

We should either force dynafed off for these tests, or just replace the PoW loop with a signed-block setup.

apoelstra avatar Nov 27 '20 20:11 apoelstra

It's been such a long time since I worked on Elements, but I think we might have decided that it was ok to require using -j1 for the unit tests. The dynafed tests always turn off dynafed after the test finishes, so when there's no concurrency, it's fine.

I just checked and Travis doesn't seem to call make check -j1 explicitly, but all Travis workers only have a single thread AFAIK.

stevenroose avatar Nov 30 '20 12:11 stevenroose