unsupported operation: can't call foreign function `rocksdb_create_default_env` on OS `linux`
()
| 262 | #[mz_ore::test(tokio::test)] |
| 263 | #[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `rocksdb_create_default_env` on OS `linux` |
| 264 | async fn update_operation_stats_test() -> Result<(), anyhow::Error> { |
| 265 | // If the test aborts, this may not be cleaned up. |
| 266 | let t = tempfile::tempdir()?; |
| 267 | |
| 268 | let mut instance = RocksDBInstance::<String, String>::new( |
| 269 | t.path().join("5").as_path(), |
| 270 | InstanceOptions::<bincode::DefaultOptions, String, StubMergeOperator<String>>::new( |
| 271 | rocksdb::Env::new()?, |
| 272 | 2, |
| 273 | None, |
| 274 | bincode::DefaultOptions::new(), |
| 275 | ), |
| 276 | RocksDBConfig::new(Default::default(), None), |
| 277 | shared_metrics_for_tests()?, |
| 278 | instance_metrics_for_tests()?, |
| 279 | )?; |
| 280 | |
| 281 | let stats = instance |
| 282 | .multi_update(vec![ |
| 283 | ( |
| 284 | "two".to_string(), |
| 285 | KeyUpdate::Put("twov1".to_string()), |
| 286 | Some(Diff::ONE), |
| 287 | ), |
| 288 | ( |
| 289 | "two".to_string(), |
| 290 | KeyUpdate::Put("twov1".to_string()), |
| 291 | Some(Diff::MINUS_ONE), |
| 292 | ), |
| 293 | ( |
| 294 | "two".to_string(), |
| 295 | KeyUpdate::Put("twov2".to_string()), |
| 296 | Some(Diff::ONE), |
| 297 | ), |
| 298 | ]) |
| 299 | .await?; |
| 300 | assert_eq!(stats.processed_updates, 3); |
| 301 | assert_eq!( |
| 302 | Diff::try_from(stats.size_written).unwrap(), |
| 303 | Diff::from(3) * stats.size_diff.unwrap() |
| 304 | ); |
| 305 | |
| 306 | instance.close().await?; |
| 307 | |
| 308 | Ok(()) |
| 309 | } |
| 310 | |
| 311 | #[mz_ore::test(tokio::test)] |
| 312 | #[cfg_attr(miri, ignore)] // unsupported operation: can't call foreign function `rocksdb_create_default_env` on OS `linux` |
nothing calls this directly
no test coverage detected