-
Notifications
You must be signed in to change notification settings - Fork 117
/
Copy pathfailure_messages.rs
120 lines (116 loc) · 4.18 KB
/
failure_messages.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
//! Failure messages logged by test child processes.
//!
//! # Warning
//!
//! Test functions in this file will not be run.
//! This file is only for test library code.
/// Failure log messages for any process, from the OS or shell.
///
/// These messages show that the child process has failed.
/// So when we see them in the logs, we make the test fail.
pub const PROCESS_FAILURE_MESSAGES: &[&str] = &[
// Linux
"Aborted",
// macOS / BSDs
"Abort trap",
// TODO: add other OS or C library errors?
];
/// Failure log messages from Zebra.
///
/// These `zebrad` messages show that the `lightwalletd` integration test has failed.
/// So when we see them in the logs, we make the test fail.
pub const ZEBRA_FAILURE_MESSAGES: &[&str] = &[
// Rust-specific panics
"The application panicked",
// RPC port errors
"Unable to start RPC server",
// TODO: disable if this actually happens during test zebrad shutdown
"Stopping RPC endpoint",
// Missing RPCs in zebrad logs (this log is from PR #3860)
//
// TODO: temporarily disable until enough RPCs are implemented, if needed
"Received unrecognized RPC request",
// RPC argument errors: parsing and data
//
// These logs are produced by jsonrpc_core inside Zebra,
// but it doesn't log them yet.
//
// TODO: log these errors in Zebra, and check for them in the Zebra logs?
"Invalid params",
"Method not found",
];
/// Failure log messages from lightwalletd.
///
/// These `lightwalletd` messages show that the `lightwalletd` integration test has failed.
/// So when we see them in the logs, we make the test fail.
pub const LIGHTWALLETD_FAILURE_MESSAGES: &[&str] = &[
// Go-specific panics
"panic:",
// Missing RPCs in lightwalletd logs
// TODO: temporarily disable until enough RPCs are implemented, if needed
"unable to issue RPC call",
// RPC response errors: parsing and data
//
// jsonrpc_core error messages from Zebra,
// received by lightwalletd and written to its logs
"Invalid params",
"Method not found",
// Early termination
//
// TODO: temporarily disable until enough RPCs are implemented, if needed
"Lightwalletd died with a Fatal error",
// Go json package error messages:
"json: cannot unmarshal",
"into Go value of type",
// lightwalletd custom RPC error messages from:
// https://github.com/adityapk00/lightwalletd/blob/master/common/common.go
"block requested is newer than latest block",
"Cache add failed",
"error decoding",
"error marshaling",
"error parsing JSON",
"error reading JSON response",
"error with",
// Block error messages
"error requesting block: 0: Block not found",
"error zcashd getblock rpc",
"received overlong message",
"received unexpected height block",
"Reorg exceeded max",
// Missing fields for each specific RPC
//
// get_block_chain_info
//
// invalid sapling height
"Got sapling height 0",
// missing BIP70 chain name, should be "main" or "test"
" chain ",
// missing branchID, should be 8 hex digits
" branchID \"",
// get_block
//
// a block error other than "-8: Block not found"
"error requesting block",
// a missing block with an incorrect error code
"Block not found",
//
// TODO: complete this list for each RPC with fields, if that RPC generates logs
// get_info - doesn't generate logs
// get_raw_transaction - might not generate logs
// z_get_tree_state
// get_address_txids
// get_address_balance
// get_address_utxos
];
/// Ignored failure logs for lightwalletd.
/// These regexes override the [`LIGHTWALLETD_FAILURE_MESSAGES`].
///
/// These `lightwalletd` messages look like failure messages, but they are actually ok.
/// So when we see them in the logs, we make the test continue.
pub const LIGHTWALLETD_EMPTY_ZEBRA_STATE_IGNORE_MESSAGES: &[&str] = &[
// Exceptions to lightwalletd custom RPC error messages:
//
// This log matches the "error with" RPC error message,
// but we expect Zebra to start with an empty state.
r#"No Chain tip available yet","level":"warning","msg":"error with getblockchaininfo rpc, retrying"#,
];