• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TyRoXx / NonlocalityOS / 21313200008

24 Jan 2026 09:48AM UTC coverage: 78.882% (+0.04%) from 78.838%
21313200008

push

github

TyRoXx
Improve error handling for too many child trees in the database

2 of 2 new or added lines in 1 file covered. (100.0%)

70 existing lines in 6 files now uncovered.

6959 of 8822 relevant lines covered (78.88%)

27915.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.44
/fuzz/fuzz_functions/src/sorted_tree_insert.rs
1
use arbitrary::Unstructured;
2
use astraea::in_memory_storage::InMemoryTreeStorage;
3
use std::collections::BTreeMap;
4
use tokio::sync::Mutex;
5

6
pub fn fuzz_function(data: &[u8]) -> bool {
2✔
7
    let mut unstructured = Unstructured::new(data);
6✔
8
    let entries: Vec<(String, i64)> = match unstructured.arbitrary() {
6✔
9
        Ok(success) => success,
4✔
UNCOV
10
        Err(_) => return false,
×
11
    };
12
    tokio::runtime::Builder::new_current_thread()
4✔
13
        .build()
14
        .unwrap()
15
        .block_on(async {
4✔
16
            let storage = InMemoryTreeStorage::new(Mutex::new(BTreeMap::new()));
8✔
17
            let mut current_state = sorted_tree::sorted_tree::new_tree::<String, i64>(&storage)
6✔
18
                .await
2✔
19
                .expect("creating a new tree should succeed");
4✔
20
            let mut oracle = BTreeMap::new();
4✔
21
            for (key, _value) in entries.iter() {
12✔
22
                let found =
5✔
23
                    sorted_tree::sorted_tree::find::<String, i64>(&storage, &current_state, key)
20✔
24
                        .await;
5✔
25
                assert_eq!(None, found);
5✔
26
            }
27
            for (key, value) in entries.iter() {
12✔
28
                current_state = sorted_tree::sorted_tree::insert::<String, i64>(
10✔
29
                    &storage,
10✔
30
                    &storage,
10✔
31
                    &current_state,
10✔
32
                    key.clone(),
15✔
33
                    *value,
5✔
34
                )
35
                .await
5✔
36
                .expect("inserting key should succeed");
10✔
37
                let found =
5✔
38
                    sorted_tree::sorted_tree::find::<String, i64>(&storage, &current_state, key)
20✔
39
                        .await;
5✔
40
                assert_eq!(Some(*value), found);
10✔
41
                oracle.insert(key.clone(), *value);
25✔
42
            }
43
            for (key, value) in oracle.iter() {
8✔
44
                let found =
2✔
45
                    sorted_tree::sorted_tree::find::<String, i64>(&storage, &current_state, key)
8✔
46
                        .await;
2✔
47
                assert_eq!(Some(*value), found);
4✔
48
            }
49
        });
50
    true
2✔
51
}
52

53
#[test]
54
fn crash_0() {
1✔
55
    assert!(fuzz_function(&[
56
        33, 183, 70, 70, 70, 70, 183, 63, 37, 19, 10
57
    ]));
58
}
59

60
#[test]
61
fn crash_1() {
1✔
62
    assert!(fuzz_function(&[
63
        255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
64
        255, 255, 255, 51
65
    ]));
66
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc