Skip to content

Commit

Permalink
update test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Jan 17, 2023
1 parent 2a232a2 commit 98c80a0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/symbolicator-service/src/services/download/sentry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl SentryDownloader {
/// If there are cached search results this skips the actual search.
async fn cached_sentry_search(&self, query: SearchQuery) -> CacheEntry<Vec<SearchResult>> {
let query_ = query.clone();
let init_future = async {
let init_future = Box::pin(async {
tracing::debug!(
"Fetching list of Sentry debug files from {}",
&query_.index_url
Expand All @@ -112,7 +112,7 @@ impl SentryDownloader {
CancelOnDrop::new(self.runtime.spawn(future.bind_hub(sentry::Hub::current())));

future.await.map_err(|_| CacheError::InternalError)?
};
});
self.index_cache
.get_with_if(query, init_future, |entry| entry.is_err())
.await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ fn normalize_minidump_os_name(os: Os) -> &'static str {
#[cfg(test)]
mod tests {
use crate::services::create_service;
use crate::services::objects::{FindObject, ObjectPurpose};
use crate::services::ppdb_caches::FetchPortablePdbCache;
use crate::services::symcaches::FetchSymCache;

Expand All @@ -531,7 +532,7 @@ mod tests {
/// The size assertion will naturally change with compiler, dependency and code changes.
#[tokio::test]
async fn future_size() {
let (sym, _) = create_service(&Default::default(), tokio::runtime::Handle::current())
let (sym, obj) = create_service(&Default::default(), tokio::runtime::Handle::current())
.await
.unwrap();

Expand All @@ -546,22 +547,32 @@ mod tests {
let fut = provider.load_cfi_module(&module);
assert_eq!(std::mem::size_of_val(&fut), 880);

let req = FindObject {
filetypes: &[],
purpose: ObjectPurpose::Debug,
identifier: Default::default(),
sources: Arc::from_iter([]),
scope: Scope::Global,
};
let fut = obj.find(req);
assert_eq!(std::mem::size_of_val(&fut), 4864);

let req = FetchCfiCache {
object_type: Default::default(),
identifier: Default::default(),
sources: Arc::from_iter([]),
scope: Scope::Global,
};
let fut = sym.cficaches.fetch(req);
assert_eq!(std::mem::size_of_val(&fut), 3456);
assert_eq!(std::mem::size_of_val(&fut), 5248);

let req = FetchPortablePdbCache {
identifier: Default::default(),
sources: Arc::from_iter([]),
scope: Scope::Global,
};
let fut = sym.ppdb_caches.fetch(req);
assert_eq!(std::mem::size_of_val(&fut), 3456);
assert_eq!(std::mem::size_of_val(&fut), 5248);

let req = FetchSymCache {
object_type: Default::default(),
Expand All @@ -570,6 +581,6 @@ mod tests {
scope: Scope::Global,
};
let fut = sym.symcaches.fetch(req);
assert_eq!(std::mem::size_of_val(&fut), 7680);
assert_eq!(std::mem::size_of_val(&fut), 11264);
}
}

0 comments on commit 98c80a0

Please sign in to comment.