bosagora / agora

POC Node implementation for CoinNet
https://bosagora.io
MIT License
37 stars 23 forks source link

Assertion sometimes thrown in unit test for `popFront on empty map` #3308

Closed hewison-chris closed 2 years ago

hewison-chris commented 2 years ago

Occasionally the ValidatorCleanRestart unit test fails in ci with the following trace:-

Unittesting agora.test.ValidatorCleanRestart================================ ASSERT HANDLER ===============================
[/opt/hostedtoolcache/dc/ldc2-1.28.1/x64/ldc2-1.28.1-linux-x86_64/bin/../import/std/algorithm/iteration.d:620] Assertion thrown during test: Attempting to popFront an empty map.
/opt/hostedtoolcache/dc/ldc2-1.28.1/x64/ldc2-1.28.1-linux-x86_64/bin/../import/std/algorithm/iteration.d:620 nothrow @safe void std.algorithm.iteration.MapResult!(agora.network.Manager.NetworkManager.getBlocksFrom(agora.common.Types.Height, agora.common.Types.Height delegate(const(agora.consensus.data.Block.Block)[]) @safe).__lambda4, agora.network.Manager.PeerRange).MapResult.popFront() [0x55c4630c30c8]
source/agora/network/Manager.d:923 nothrow void agora.network.Manager.NetworkManager.getBlocksFrom(agora.common.Types.Height, agora.common.Types.Height delegate(const(agora.consensus.data.Block.Block)[]) @safe) [0x55c462f45af6]
source/agora/node/FullNode.d:566 nothrow void agora.node.FullNode.FullNode.catchupTask() [0x55c462ec79e4]
source/agora/common/Task.d:76 [0x55c46325179f]
source/agora/common/Task.d:73 [0x55c463251774]
submodules/localrest/source/geod24/LocalRest.d:578 nothrow @safe void geod24.LocalRest.Timer.run() [0x55c46[373](https://github.com/bosagora/agora/runs/6060731956?check_suite_focus=true#step:11:373)9e67]
core/thread/context.d:46 void core.thread.context.Callable.opCall() [0x55c463d2b72c]
core/thread/fiber.d:1151 void core.thread.fiber.Fiber.run() [0x55c463cc6478]
core/thread/fiber.d:198 fiber_entryPoint [0x55c463cc63b5]
#### FATAL ERROR: Attempting to popFront an empty map.
This node was started at source/agora/test/ValidatorCleanRestart.d:44
This most likely means that the node crashed due to an uncaught exception
If not, please file a bug at https://github.com/Geod24/localrest/
Full error: core.exception.AssertError@/opt/hostedtoolcache/dc/ldc2-1.28.1/x64/ldc2-1.28.1-linux-x86_64/bin/../import/std/algorithm/iteration.d(620): Attempting to popFront an empty map.
----------------
source/agora/test/Base.d:180 nothrow void agora.test.Base.testAssertHandler(immutable(char)[], ulong, immutable(char)[]) [0x55c462f409aa]
core/exception.d:601 onAssertErrorMsg [0x55c463cbf211]
core/exception.d:795 _d_assert_msg [0x55c463cbf755]
/opt/hostedtoolcache/dc/ldc2-1.28.1/x64/ldc2-1.28.1-linux-x86_64/bin/../import/std/algorithm/iteration.d:620 nothrow @safe void std.algorithm.iteration.MapResult!(agora.network.Manager.NetworkManager.getBlocksFrom(agora.common.Types.Height, agora.common.Types.Height delegate(const(agora.consensus.data.Block.Block)[]) @safe).__lambda4, agora.network.Manager.PeerRange).MapResult.popFront() [0x55c4630c30c8]
source/agora/network/Manager.d:923 nothrow void agora.network.Manager.NetworkManager.getBlocksFrom(agora.common.Types.Height, agora.common.Types.Height delegate(const(agora.consensus.data.Block.Block)[]) @safe) [0x55c462f45af6]
source/agora/node/FullNode.d:566 nothrow void agora.node.FullNode.FullNode.catchupTask() [0x55c462ec79e4]
source/agora/common/Task.d:76 [0x55c46325179f]
source/agora/common/Task.d:73 [0x55c463251774]
submodules/localrest/source/geod24/LocalRest.d:578 nothrow @safe void geod24.LocalRest.Timer.run() [0x55c463739e67]
core/thread/context.d:46 void core.thread.context.Callable.opCall() [0x55c463d2b72c]
core/thread/fiber.d:1151 void core.thread.fiber.Fiber.run() [0x55c463cc6478]
core/thread/fiber.d:198 fiber_entryPoint [0x55c463cc63b5]