Skip to content

Commit

Permalink
multiplePeers tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MacOMNI committed Jan 8, 2025
1 parent 324a43f commit 40bf0d7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public actor BlockchainDataProvider: Sendable {
bestHead = HeadInfo(hash: block.hash, timeslot: block.header.timeslot, number: number)
}

logger.debug("block imported: \(block.hash)")
logger.info("block Imported: #\(bestHead.timeslot) \(block.hash)")
}
}

Expand Down
12 changes: 12 additions & 0 deletions Node/.swiftpm/xcode/xcshareddata/xcschemes/Node.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NodeTests"
BuildableName = "NodeTests"
BlueprintName = "NodeTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand Down
6 changes: 3 additions & 3 deletions Node/Tests/NodeTests/NodeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ final class NodeTests {
let (node1, node1StoreMiddlware) = nodes[2]
let (node2, node2StoreMiddlware) = nodes[3]

try await Task.sleep(for: .milliseconds(500))
try await Task.sleep(for: .milliseconds(nodes.count * 500))

// Verify connections
#expect(node1.network.peersCount == 2)
Expand All @@ -162,13 +162,13 @@ final class NodeTests {
await node2StoreMiddlware.wait()
}

try await Task.sleep(for: .milliseconds(1000))
try await Task.sleep(for: .milliseconds(nodes.count * 500))

let validator1BestHead = await validator1.dataProvider.bestHead
let validator2BestHead = await validator2.dataProvider.bestHead
let node1BestHead = await node1.dataProvider.bestHead
let node2BestHead = await node2.dataProvider.bestHead

Check failure on line 171 in Node/Tests/NodeTests/NodeTests.swift

View workflow job for this annotation

GitHub Actions / Swift Lint

Trailing Whitespace (trailing_whitespace)

Lines should not have trailing whitespace
#expect(validator1BestHead.hash == node1BestHead.hash)
#expect(validator1BestHead.hash == node2BestHead.hash)
#expect(validator2BestHead.hash == node1BestHead.hash)
Expand Down

0 comments on commit 40bf0d7

Please sign in to comment.