Skip to content

Commit 36d2c25

Browse files
committed
Evolve: Migrate tikv#129 regression test to test crate
Signed-off-by: Mark Van de Vyver <[email protected]>
1 parent 0c0b807 commit 36d2c25

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

minitrace-macro/tests/expand/issues/129.expanded.rs

Lines changed: 0 additions & 4 deletions
This file was deleted.

minitrace-macro/tests/expand/issues/129.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use minitrace::trace;
2+
3+
#[trace]
4+
async fn test_async() {}
5+
6+
#[trace]
7+
fn test_sync() {}
8+
9+
#[cfg_attr(feature = "tk", tokio::main)]
10+
#[cfg_attr(not(feature = "tk"), async_std::main)]
11+
async fn main() {
12+
let (root, collector) = minitrace::Span::root("root");
13+
{
14+
let _g = root.set_local_parent();
15+
test_async(1).await;
16+
test_sync();
17+
}
18+
drop(root);
19+
let records: Vec<minitrace::collector::SpanRecord> = futures::executor::block_on(collector.collect());
20+
21+
// Enforce future send
22+
// tokio::Runtime::spawn(test_async().await);
23+
test_async().await;
24+
25+
test_sync();
26+
}

0 commit comments

Comments
 (0)