Fix up tests
This commit is contained in:
@ -15,5 +15,8 @@ lazy_static = "1.2.0"
|
||||
sys-info = "0.5.6"
|
||||
solana-sdk = { path = "../sdk", version = "0.11.0" }
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.6.1"
|
||||
|
||||
[lib]
|
||||
name = "solana_metrics"
|
||||
|
@ -267,8 +267,9 @@ pub fn set_panic_hook(program: &'static str) {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
extern crate rand;
|
||||
|
||||
use super::*;
|
||||
use rand::random;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
||||
struct MockMetricsWriter {
|
||||
@ -371,11 +372,11 @@ mod test {
|
||||
.add_tag("test", influxdb::Value::Boolean(true))
|
||||
.add_field(
|
||||
"random_bool",
|
||||
influxdb::Value::Boolean(random::<u8>() < 128),
|
||||
influxdb::Value::Boolean(rand::random::<u8>() < 128),
|
||||
)
|
||||
.add_field(
|
||||
"random_int",
|
||||
influxdb::Value::Integer(random::<u8>() as i64),
|
||||
influxdb::Value::Integer(rand::random::<u8>() as i64),
|
||||
)
|
||||
.to_owned();
|
||||
agent.submit(point);
|
||||
|
Reference in New Issue
Block a user