File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -249,3 +249,8 @@ speculoos = { workspace = true }
249
249
tower-test = { workspace = true }
250
250
tracing-test = { workspace = true }
251
251
temp-env = { version = " =0.3.6" , features = [" async_closure" ] }
252
+
253
+ # For sputnik, run tests with debug_assertions disabled. This is necessary because telemetry is not sent if
254
+ # debug_assertions is enabled, and the tests rely on telemetry being sent to mock APIs.
255
+ [profile .test .package .sputnik ]
256
+ debug-assertions = false
Original file line number Diff line number Diff line change @@ -17,8 +17,9 @@ use std::time::Duration;
17
17
18
18
use crate :: { Report , SputnikError } ;
19
19
20
- // set timeout to 100 ms to prevent blocking for too long on reporting; 30ms p99
21
- const REPORT_TIMEOUT : Duration = Duration :: from_millis ( 100 ) ;
20
+ /// Timeout for reporting telemetry. Note that this includes the entire time to make the request
21
+ /// and receive the response, including on the client side. This is not just the server latency.
22
+ const REPORT_TIMEOUT : Duration = Duration :: from_millis ( 500 ) ;
22
23
23
24
/// The Session represents a usage of the CLI analogous to a web session
24
25
/// It contains the "url" (command path + flags) but doesn't contain any
@@ -141,8 +142,9 @@ impl Session {
141
142
/// sends anonymous usage data to the endpoint defined in ReportingInfo.
142
143
pub async fn report ( & self ) -> Result < ( ) , SputnikError > {
143
144
// TODO: consider whether we want to disable non-production telemetry or at least document
144
- // the reasoning for not using it
145
- if !cfg ! ( debug_assertions) && !cfg ! ( test) {
145
+ // the reasoning for not using it
146
+ if cfg ! ( debug_assertions) {
147
+ tracing:: debug!( "Skipping telemetry reporting" ) ;
146
148
return Ok ( ( ) ) ;
147
149
}
148
150
if self . reporting_info . is_telemetry_enabled {
You can’t perform that action at this time.
0 commit comments