Skip to content

Commit 2461302

Browse files
Merge pull request #21 from OpenArchive/feat/veilid-0.5.1-upgrade
Veilid dependency upgrade
2 parents 605d9b9 + f686970 commit 2461302

23 files changed

Lines changed: 1972 additions & 1199 deletions

.cargo/config-android.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ ar = "llvm-ar"
88
[target.armv7-linux-androideabi]
99
linker = "armv7a-linux-androideabi34-clang"
1010
ar = "llvm-ar"
11+
12+
[target.x86_64-linux-android]
13+
linker = "x86_64-linux-android34-clang"
14+
ar = "llvm-ar"

.config/nextest.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Nextest configuration for save-rust
2+
# Veilid/DHT tests can be slow and flaky due to P2P peer discovery and network setup.
3+
4+
[profile.default]
5+
# Set timeout to 10 minutes per test (Veilid network operations can be slow)
6+
# Terminate after 10 periods of 60s.
7+
slow-timeout = { period = "60s", terminate-after = 10 }
8+
9+
# Retry flaky tests with exponential backoff to give Veilid time to connect
10+
retries = { backoff = "exponential", count = 3, delay = "5s", max-delay = "30s" }
11+
12+
# Run tests serially to avoid Veilid network conflicts
13+
test-threads = 1
14+
15+
# P2P tests are flaky in CI, but very high retry counts can stretch failures to >1h.
16+
# Keep retries moderate so truly broken runs fail fast.
17+
[[profile.default.overrides]]
18+
filter = 'test(test_replicate_group) | test(test_join_group)'
19+
retries = { backoff = "exponential", count = 4, delay = "8s", max-delay = "45s", jitter = true }
20+
21+
[[profile.default.overrides]]
22+
filter = 'test(test_refresh_joined_group)'
23+
retries = { backoff = "exponential", count = 2, delay = "8s", max-delay = "30s", jitter = true }
24+
slow-timeout = { period = "60s", terminate-after = 5 }
25+
26+
# Faster CI profile used for PR runs.
27+
[profile.ci-virtual]
28+
slow-timeout = { period = "30s", terminate-after = 4 }
29+
retries = { backoff = "exponential", count = 1, delay = "3s", max-delay = "10s", jitter = true }
30+
test-threads = 1
31+
32+
[[profile.ci-virtual.overrides]]
33+
filter = 'test(test_replicate_group) | test(test_join_group)'
34+
retries = { backoff = "exponential", count = 2, delay = "5s", max-delay = "20s", jitter = true }
35+
slow-timeout = { period = "45s", terminate-after = 4 }
36+
37+
[[profile.ci-virtual.overrides]]
38+
filter = 'test(test_refresh_joined_group)'
39+
retries = { backoff = "exponential", count = 1, delay = "5s", max-delay = "15s", jitter = true }
40+
slow-timeout = { period = "45s", terminate-after = 4 }

.github/workflows/lint_and_test.yml

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ on:
77
- main
88

99
jobs:
10-
lint:
10+
lint_and_test:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 75
13+
1214
steps:
1315
- name: Set up Rust toolchain
1416
uses: hecrj/setup-rust-action@v2
@@ -24,37 +26,18 @@ jobs:
2426
- name: Run Clippy
2527
run: cargo clippy --all-targets --all-features -- -D warnings
2628

27-
test:
28-
needs: lint
29-
runs-on: ubuntu-latest
30-
timeout-minutes: 15
31-
strategy:
32-
matrix:
33-
test_name: [
34-
"tests::basic_test",
35-
"tests::test_health_endpoint",
36-
"tests::test_join_group",
37-
"tests::test_refresh_empty_group",
38-
"tests::test_refresh_group_with_file",
39-
"tests::test_refresh_group_with_single_repo",
40-
# Skipping: flaky P2P peer discovery (see issue #TODO)
41-
# "tests::test_refresh_joined_group",
42-
"tests::test_refresh_nonexistent_group",
43-
# Skipping: flaky P2P peer discovery (see issue #TODO)
44-
# "tests::test_replicate_group",
45-
"tests::test_upload_list_delete"
46-
]
47-
48-
steps:
49-
- name: Set up Rust toolchain
50-
uses: hecrj/setup-rust-action@v2
51-
with:
52-
rust-version: stable
53-
54-
- name: Check out the code
55-
uses: actions/checkout@v4
29+
- name: Install cargo-nextest
30+
run: cargo install cargo-nextest --locked
5631

57-
- name: Run individual test
32+
- name: Run tests with retries
5833
env:
5934
RUST_MIN_STACK: 8388608
60-
run: cargo test --verbose -- ${{ matrix.test_name }} --test-threads=1 --nocapture
35+
SAVE_VEILID_LOCAL_TEST_MODE: "1"
36+
# Retries configured in .config/nextest.toml (nextest default path)
37+
# --no-fail-fast: run all tests in this PR subset even when some fail.
38+
# Exclude long P2P network convergence tests from PR CI; run them in dedicated/nightly workflows.
39+
run: >
40+
cargo nextest run
41+
--profile ci-virtual
42+
--no-fail-fast
43+
-E 'not (test(test_join_group) | test(test_replicate_group) | test(test_refresh_joined_group) | test(test_idempotent_create_repo_after_join))'

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@
22
/target
33
platform-build
44
private-*
5+
test_*.log
6+
.cursor/
7+
save-data/
8+
test-output.txt
9+
test_refresh_joined_group_output.txt

API.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,14 @@ Request Body: Binary file content
414414
Response:
415415
```json
416416
{
417-
"name": "string", // File name
418-
"updated_collection_hash": "string" // Hash of the updated collection
417+
"name": "string", // File name
418+
"updated_collection_hash": "string", // Hash of the updated collection
419+
"file_hash": "string" // Hash of the uploaded file
419420
}
420421
```
421422

423+
`file_hash` is the Veilid content hash stored in the DHT. Clients can use it to verify local uploads, deduplicate media, or trigger replication via the refresh endpoints if the hash is missing locally.
424+
422425
Error Response (400 Bad Request):
423426
```json
424427
{

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
## 2026-02-03
4+
5+
- Upgrade to `veilid-core` v0.5.1, applying the temporary `fix-underflow` patch while the upstream bugfix is under review.
6+
- Adopt `cargo-nextest` with retries in CI to stabilize Veilid/DHT-related tests.

0 commit comments

Comments
 (0)