planetarium / libplanet

Blockchain in C#/.NET for on-chain, decentralized gaming
https://docs.libplanet.io/
GNU Lesser General Public License v2.1
506 stars 142 forks source link

Mitigate flakiness of CI/CD #1547

Closed dahlia closed 1 year ago

dahlia commented 2 years ago

The last few weeks, we haven't been able to merge pull requests with the complete green checks nor seen the green status badge from the README:

Build Status

To me, it looks quite dangerous because we are getting insensitive to red lights. At least, we should be able to see more greens than reds.


Related issues and pull requests:

dahlia commented 2 years ago

Another flaky test:

Libplanet.Tests.Net.IceServerTest.CreateTurnClient [FAIL]
  Libplanet.Net.IceServerException : Can't find suitable server.
  Stack Trace:
       at Libplanet.Net.IceServer.CreateTurnClient(IEnumerable`1 iceServers)
    D:\a\1\s\Libplanet.Tests\Net\IceServerTest.cs(35,0): at Libplanet.Tests.Net.IceServerTest.CreateTurnClient()
    --- End of stack trace from previous location where exception was thrown ---
riemannulus commented 2 years ago

Another flaky test: https://dev.azure.com/planetarium/libplanet/_build/results?buildId=6083&view=logs&j[…]9f9e-6014c2ac1eb8&t=e47d51dc-1570-5429-77c0-0a38014f56be&l=932

Libplanet.Tests.Net.SwarmTest.BroadcastTxAsync [FAIL]
      Test execution timed out after 60000 milliseconds
      Output:
        06:46:47:966301Z[@][120] - Trying to append block 0: "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15"
        06:46:47:966636Z[@][120] - Executing actions in the block #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15"...
        06:46:47:966664Z[@][120] - Evaluating actions in the block #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15"...
        06:46:47:966813Z[@][120] - Evaluated actions in the block #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15" (duration: 0.1262ms).
        06:46:47:966928Z[@][120] - Summarized the states delta made by the block #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15".  Total 2 key(s) changed.
        06:46:47:967056Z[@][120] - Calculated the root hash of the states made by the block #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15" for TrieStateStore: "8251964afa1072d849241dc3c1a7e7c40257a5356c633e097db399f89426b8e1".
        06:46:47:967084Z[@][120] - Finished to update states affected by the block #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15" (duration: 0.2442ms).
        06:46:47:967117Z[@][120] - Prepared TxExecutions for 0 transactions within the block #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15".
        06:46:47:967134Z[@][120] - Updated TxExecutions for 0 transactions.
        06:46:47:967148Z[@][120] - Executed actions in the block #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15".
        06:46:47:967229Z[@][120] - Unstaging 1 transaction(s) which belong to the block #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15"...
        06:46:47:967282Z[@][120] - Unstaged 0 transaction(s), which belong to the block #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15"...
        06:46:47:967302Z[@][120] - Appended the block #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15".
        06:46:47:967321Z[@][120] - Invoking renderers for #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15"... (1 renderer(s), 1 action renderer(s))
        06:46:47:971028Z[@][120] - Render actions in block 0: "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15"
        06:46:47:975279Z[@][120] - Invoked renderers for #0 "91d35a27131d628820cee72a46f6c751318c3aec6cd78363e76fe7a0fb644a15"... (1 renderer(s), 1 action renderer(s))
        06:46:51:455827Z[@B48dCC00e3fAF27b438304CAba6B019EE73b1F9c][67] - Trying to broadcast blocks...
        06:46:51:458072Z[@B48dCC00e3fAF27b438304CAba6B019EE73b1F9c][67] - An unexpected exception occurred during BroadcastBlockAsync(): NetMQ.TerminatingException: CheckContextTerminated - yes, is terminated.
           at NetMQ.Core.SocketBase.CheckContextTerminated()
           at NetMQ.Core.SocketBase.TrySend(Msg& msg, TimeSpan timeout, Boolean more)
           at NetMQ.NetMQSocket.TrySend(Msg& msg, TimeSpan timeout, Boolean more)
           at NetMQ.NetMQQueue`1.Enqueue(T value)
           at Libplanet.Net.Transports.NetMQTransport.BroadcastMessage(Nullable`1 except, Message message) in D:\a\1\s\Libplanet\Net\Transports\NetMQTransport.cs:line 533
           at Libplanet.Net.Swarm`1.BroadcastBlock(Nullable`1 except, Block`1 block) in D:\a\1\s\Libplanet\Net\Swarm.cs:line 1011
           at Libplanet.Net.Swarm`1.BroadcastBlockAsync(TimeSpan broadcastBlockInterval, CancellationToken cancellationToken) in D:\a\1\s\Libplanet\Net\Swarm.cs:line 1160
        06:46:51:458240Z[@FbE874C0665771B61C01B3F358b3eDBfF95B5b0D][67] - Trying to broadcast blocks...
        06:46:51:458954Z[@FbE874C0665771B61C01B3F358b3eDBfF95B5b0D][67] - An unexpected exception occurred during BroadcastBlockAsync(): NetMQ.TerminatingException: CheckContextTerminated - yes, is terminated.
           at NetMQ.Core.SocketBase.CheckContextTerminated()
           at NetMQ.Core.SocketBase.TrySend(Msg& msg, TimeSpan timeout, Boolean more)
           at NetMQ.NetMQSocket.TrySend(Msg& msg, TimeSpan timeout, Boolean more)
           at NetMQ.NetMQQueue`1.Enqueue(T value)
           at Libplanet.Net.Transports.NetMQTransport.BroadcastMessage(Nullable`1 except, Message message) in D:\a\1\s\Libplanet\Net\Transports\NetMQTransport.cs:line 533
           at Libplanet.Net.Swarm`1.BroadcastBlock(Nullable`1 except, Block`1 block) in D:\a\1\s\Libplanet\Net\Swarm.cs:line 1011
           at Libplanet.Net.Swarm`1.BroadcastBlockAsync(TimeSpan broadcastBlockInterval, CancellationToken cancellationToken) in D:\a\1\s\Libplanet\Net\Swarm.cs:line 1160
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

riemannulus commented 2 years ago
[xUnit.net 00:01:09.38]     Libplanet.Tests.Blockchain.Renderers.DelayedActionRendererTest.ClearRenderBufferWhenItsInterval [FAIL]
  X Libplanet.Tests.Blockchain.Renderers.DelayedActionRendererTest.ClearRenderBufferWhenItsInterval [1m 7s]
  Error Message:
   Assert.Equal() Failure
Expected: 17
Actual:   14
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.