File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 8383 test :
8484 name : Integration Test
8585 runs-on : ubuntu-latest
86- needs : [build, build -for-testing, build-decoder, build-async-profiler]
86+ needs : [build-for-testing, build-decoder, build-async-profiler]
8787 steps :
8888 - uses : actions/checkout@v4
8989 - name : Download pollcatch-decoder
Original file line number Diff line number Diff line change @@ -51,28 +51,33 @@ struct Args {
5151 #[ arg( long, default_value = "30s" ) ]
5252 #[ clap( value_parser = humantime:: parse_duration) ]
5353 reporting_interval : Duration ,
54+ #[ arg( long) ]
55+ worker_threads : Option < usize > ,
5456}
5557
5658#[ allow( unexpected_cfgs) ]
5759pub fn main ( ) -> anyhow:: Result < ( ) > {
60+ let args = Args :: parse ( ) ;
61+
5862 let mut rt: tokio:: runtime:: Builder = tokio:: runtime:: Builder :: new_multi_thread ( ) ;
5963 rt. enable_all ( ) ;
64+ if let Some ( worker_threads) = args. worker_threads {
65+ rt. worker_threads ( worker_threads) ;
66+ }
6067
6168 #[ cfg( tokio_unstable) ]
6269 {
6370 rt. on_before_task_poll ( |_| async_profiler_agent:: pollcatch:: before_poll_hook ( ) )
6471 . on_after_task_poll ( |_| async_profiler_agent:: pollcatch:: after_poll_hook ( ) ) ;
6572 }
6673 let rt = rt. build ( ) . unwrap ( ) ;
67- rt. block_on ( main_internal ( ) )
74+ rt. block_on ( main_internal ( args ) )
6875}
6976
70- async fn main_internal ( ) -> Result < ( ) , anyhow:: Error > {
77+ async fn main_internal ( args : Args ) -> Result < ( ) , anyhow:: Error > {
7178 set_up_tracing ( ) ;
7279 tracing:: info!( "main started" ) ;
7380
74- let args = Args :: parse ( ) ;
75-
7681 let profiler = ProfilerBuilder :: default ( ) ;
7782
7883 let profiler = match (
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ set -exuo pipefail
99
1010mkdir -p profiles
1111rm -f profiles/* .jfr
12- ./simple --local profiles --duration 60s --reporting-interval 15s
12+ # Pass --worker-threads 16 to make the test much less flaky since there is always some worker thread running
13+ ./simple --local profiles --duration 60s --reporting-interval 15s --worker-threads 16
1314for profile in profiles/* .jfr; do
1415 short_sleeps_100=$( ./pollcatch-decoder longpolls --stack-depth=10 " $profile " 100us | ( grep -c short_sleep_2 || true ))
1516 short_sleeps_1000=$( ./pollcatch-decoder longpolls --stack-depth=10 " $profile " 1000us | ( grep -c short_sleep_2 || true ))
You can’t perform that action at this time.
0 commit comments