ChainSafe / ChainSafe/gossamer

Flaky Test In dot/peerset/peerset_test.go

Open
#3,366 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

## Describe the bug

Sometimes succeeds, sometimes doesn't. Looks like when it fails its due to the times being equal, so milliseconds matter here.

```
triedToConnectAt := ps.peerState.nodes[peer1].lastConnected[testSetID]
require.True(t, lastDisconectedAt.Before(triedToConnectAt))
```

`go test -timeout 30s -run $Test$ github.com/ChainSafe/gossamer/dot/peerset -count=1`

```
=== TestBanRejectAcceptPeer
peerset_test.go:56:
Error Trace: C:/Users/User/Path/To/gossamer/dot/peerset/peerset_test.go:56
Error: Should be true
Test: TestBanRejectAcceptPeer
```

```
lastDisconnectedAt: 2023-07-05 02:24:22.0133831 -0400 EDT m=+0.112701101
triedToConnectAt: 2023-07-05 02:24:22.0133831 -0400 EDT m=+0.112701101
Equal Times: true
```

Machine: Windows 10 x64 based
Version: 10.0.19045 Build 19045

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.