Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/daily_i386.yml
Comment thread
gmelodie marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Daily i386

on:
schedule:
- cron: "31 6 * * *"
workflow_dispatch:
pull_request:
types: [labeled, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test_i386_latest:
name: Daily i386 (latest dependencies)
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-daily-ci')
uses: ./.github/workflows/daily_common.yml
Comment thread
gmelodie marked this conversation as resolved.
Resolved
with:
nim: "[
{'ref': 'v2.2.4', 'memory_management': 'refc'},
{'ref': 'v2.2.10', 'memory_management': 'refc'},
{'ref': 'devel', 'memory_management': 'refc'},
]"
configuration: "[
{'os': 'linux', 'cpu': 'i386', 'cc': 'gcc', 'builder': 'ubuntu-22.04', 'shell': 'bash'},
]"
7 changes: 7 additions & 0 deletions .github/workflows/daily_nimbus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ on:
schedule:
- cron: "30 6 * * *"
workflow_dispatch:
pull_request:
types: [labeled, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
compile_nimbus:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-daily-ci')
timeout-minutes: 80
name: 'Compile Nimbus (linux-amd64)'
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/daily_test_all_no_flags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ on:
schedule:
- cron: "0 12 * * *"
workflow_dispatch:
pull_request:
types: [labeled, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tests-no-flags:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-daily-ci')
timeout-minutes: 55
strategy:
fail-fast: false
Expand Down
39 changes: 33 additions & 6 deletions tests/libp2p/protocols/test_dcutr.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ import ../../tools/[unittest, switch_builder, multiaddress]
proc makeSwitch(address: MultiAddress = TcpAutoAddress): Switch =
return makeStandardSwitch(address)

proc waitDirectConnIdentified(
clientSwitch: Switch, serverPeerId: PeerId
): Future[void].Raising([CancelledError]) =
# Completes once the direct (second) connection to `serverPeerId` has been
# fully identified. The inbound upgrade bumps connCount before opening the
# identify stream, so waiting on connCount alone tears the switch down while
# that identify LPChannel is still being opened, leaking it on slow runners.
let identified =
Future[void].Raising([CancelledError]).init("dcutr direct connection identified")

proc onIdentified(
peerId: PeerId, event: PeerEvent
): Future[void] {.async: (raises: [CancelledError]).} =
if peerId == serverPeerId and clientSwitch.connManager.connCount(serverPeerId) == 2:
identified.completeOnce()

clientSwitch.connManager.addPeerEventHandler(onIdentified, PeerEventKind.Identified)
identified

suite "Dcutr":
teardown:
checkTrackers()
Expand Down Expand Up @@ -59,6 +78,9 @@ suite "Dcutr":
let dcutrProto = Dcutr.new(publicSwitch)
publicSwitch.mount(dcutrProto)

let directConnIdentified =
waitDirectConnIdentified(behindNATSwitch, publicSwitch.peerInfo.peerId)

await allFutures(behindNATSwitch.start(), publicSwitch.start())
defer:
await allFutures(behindNATSwitch.stop(), publicSwitch.stop())
Expand All @@ -81,9 +103,10 @@ suite "Dcutr":
)
.wait(300.millis)

checkUntilTimeout:
# we still expect a new connection to be open by the receiver peer acting as the dcutr server
behindNATSwitch.connManager.connCount(publicSwitch.peerInfo.peerId) == 2
# we still expect a new connection to be open by the receiver peer acting as
# the dcutr server; wait until it is identified so teardown doesn't race the
# inbound identify stream
check await directConnIdentified.withTimeout(30.seconds)

asyncTest "DCUtR establishes a new QUIC connection":
let behindNATSwitch = makeSwitch(QuicAutoAddress)
Expand Down Expand Up @@ -139,6 +162,9 @@ suite "Dcutr":
let dcutrProto = Dcutr.new(publicSwitch)
publicSwitch.mount(dcutrProto)

let directConnIdentified =
waitDirectConnIdentified(behindNATSwitch, publicSwitch.peerInfo.peerId)

await allFutures(behindNATSwitch.start(), publicSwitch.start())
defer:
await allFutures(behindNATSwitch.stop(), publicSwitch.stop())
Expand All @@ -152,9 +178,10 @@ suite "Dcutr":

body

checkUntilTimeout:
# we still expect a new connection to be open by the receiver peer acting as the dcutr server
behindNATSwitch.connManager.connCount(publicSwitch.peerInfo.peerId) == 2
# we still expect a new connection to be open by the receiver peer acting as
# the dcutr server; wait until it is identified so teardown doesn't race the
# inbound identify stream
check await directConnIdentified.withTimeout(30.seconds)

asyncTest "Client connect timeout":
proc connectTimeoutProc(
Expand Down
Loading