Skip to content

Commit 9bd0353

Browse files
authored
chore: upgrade to iroh-net 0.28.1 and quinn 0.12 (#32)
* upgrade to iroh-net 0.28.1 and quinn 0.12 * fix coordination issues in tests
1 parent 7f7467a commit 9bd0353

File tree

3 files changed

+59
-11
lines changed

3 files changed

+59
-11
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ jobs:
6161
env:
6262
LD_LIBRARY_PATH: target/release
6363
- name: test run
64+
id: run_tests
65+
continue-on-error: true
6466
env:
6567
LD_LIBRARY_PATH: target/release
6668
run: |
6769
./main server --json > server_output.json &
70+
server_pid=$!
6871
# Wait for the server to start
69-
sleep 3
72+
sleep 10
7073
# Read the second line of the file
7174
line=$(sed -n '2p' server_output.json)
7275
@@ -87,13 +90,22 @@ jobs:
8790
./main client $node_id $relay ${addrs[@]}
8891
sleep 10
8992
93+
# wait for server the shutdown
94+
wait $server_pid
95+
server_status=$?
96+
echo ""
97+
echo "Server closed with status $server_status"
98+
if [[ "$server_status" != "0" ]]; then
99+
exit 1
100+
fi
101+
90102
# Read the 3rd line of the file
91103
last_line=$(sed -n '3p' server_output.json)
92104
# Parse the JSON
93105
json_output=$(echo $last_line | jq -r '.data')
94106
# Ensure json_output is as expected
95107
if [[ "$json_output" != "hello world from C" ]]; then
96-
echo "Error: Unexpected output"
108+
echo "Error: Unexpected output for line 3"
97109
echo "server_output.json:"
98110
cat server_output.json
99111
exit 1
@@ -105,13 +117,22 @@ jobs:
105117
json_output=$(echo $last_line | jq -r '.data')
106118
# Ensure json_output is as expected
107119
if [[ "$json_output" != "hello world from C" ]]; then
108-
echo "Error: Unexpected output"
120+
echo "Error: Unexpected output for line 6"
109121
echo "server_output.json:"
110122
cat server_output.json
111123
exit 1
112124
fi
113125
126+
echo ""
114127
echo "Success"
128+
echo "server_output.json:"
129+
cat server_output.json
130+
- name: Fail Job if Tests Failed
131+
if: ${{ steps.run_tests.outcome == 'failure' }}
132+
run: |
133+
echo "Tests failed, server logs are:"
134+
cat server_output.json
135+
exit 1
115136
- name: check headers
116137
shell: bash
117138
run: |
@@ -179,10 +200,12 @@ jobs:
179200
env:
180201
LD_LIBRARY_PATH: target/release
181202
- name: test run
203+
id: run_tests
204+
continue-on-error: true
182205
run: |
183-
Start-Process -NoNewWindow -FilePath "./main.exe" -ArgumentList "server", "--json" -RedirectStandardOutput "server_output.json"
206+
$server_process = Start-Process -PassThru -NoNewWindow -FilePath "./main.exe" -ArgumentList "server", "--json" -RedirectStandardOutput "server_output.json"
184207
# Wait for the server to start
185-
Start-Sleep -Seconds 3
208+
Start-Sleep -Seconds 10
186209
# Read the second line of the file
187210
$line = Get-Content server_output.json | Select-Object -Index 1
188211
@@ -199,15 +222,29 @@ jobs:
199222
$relay = $json_output.relay
200223
$addrs = $json_output.addrs
201224
& "./main" "client" $node_id $relay $addrs
202-
Start-Sleep -Seconds 3
225+
Start-Sleep -Seconds 10
226+
227+
# wait for the server process to terminate
228+
Wait-Process -InputObject $server_process
229+
230+
# # ramfox: ExitCode in windows seems to not work in all environments. I've tried a few variations, but they all show the exitCode as Null. commenting this out for now.
231+
# $exitCode = $server_process.ExitCode
232+
233+
# Write-Output ""
234+
# Write-Output "Server process exited with code: $exitCode"
235+
236+
# if ($exitCode -ne 0) {
237+
# exit 1
238+
# }
203239
204240
# Read the 3rd line of the file
205241
$last_line = Get-Content server_output.json | Select-Object -Index 2
206242
# Parse the JSON
207243
$json_output = ConvertFrom-Json $last_line
208244
# Ensure json_output is as expected
209245
if ($json_output.data -ne "hello world from C") {
210-
Write-Output "Error: Unexpected output"
246+
Write-Output "Error: Unexpected output for line 3"
247+
Write-Output $json_output
211248
exit 1
212249
}
213250
@@ -217,10 +254,20 @@ jobs:
217254
$json_output = ConvertFrom-Json $last_line
218255
# Ensure json_output is as expected
219256
if ($json_output.data -ne "hello world from C") {
220-
Write-Output "Error: Unexpected output"
257+
Write-Output "Error: Unexpected output for line 6"
258+
Write-Output $json_output
221259
exit 1
222260
}
261+
Write-Output ""
223262
Write-Output "Success"
263+
Write-Output "server_output.json:"
264+
Get-Content server_output.json
265+
- name: Fail Job if Tests Failed
266+
if: ${{ steps.run_tests.outcome == 'failure' }}
267+
run: |
268+
Write-Output "Tests failed, server logs are:"
269+
Get-Content server_output.json
270+
exit 1
224271
225272
android_build:
226273
name: Android Build Only

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "iroh-net-ffi"
3-
version = "0.27.0"
3+
version = "0.28.1"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66

@@ -19,9 +19,9 @@ required-features = ["headers"] # Do not build unless generating headers.
1919
[dependencies]
2020
anyhow = "1.0.79"
2121
bytes = "1.5.0"
22-
iroh-net = { version = "0.27", features = ["discovery-local-network"] }
22+
iroh-net = { version = "0.28", features = ["discovery-local-network"] }
2323
once_cell = "1.19.0"
24-
quinn = { version = "0.11.3", package = "iroh-quinn" }
24+
quinn = { version = "0.12", package = "iroh-quinn" }
2525
safer-ffi = { version = "0.1.5" }
2626
socket2 = "0.5.7"
2727
tokio = { version = "1.36.0", features = ["rt-multi-thread"] }

deny.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ allow = [
1414
"Unicode-DFS-2016",
1515
"Zlib",
1616
"MPL-2.0", # https://fossa.com/blog/open-source-software-licenses-101-mozilla-public-license-2-0/
17+
"Unicode-3.0",
1718
]
1819

1920
[[licenses.clarify]]

0 commit comments

Comments
 (0)