File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
spec/datadog/di/integration Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ def test_method(a = 1)
2020 42
2121 end
2222
23+ def long_test_method
24+ # This method is used to assert on @duration, and +test_method+
25+ # somehow managed to report an execution time of 0.0 in CI one time
26+ # (though normally it takes about 1 microsecond).
27+ Object . methods . length > 0 and 42
28+ end
29+
2330 def mutating_method ( greeting )
2431 greeting . sub! ( 'hello' , 'bye' )
2532 end
@@ -520,6 +527,15 @@ def run_test
520527 ]
521528 end
522529
530+ let ( :probe_spec ) do
531+ {
532+ id : '1234' ,
533+ type : 'LOG_PROBE' ,
534+ where : { typeName : 'InstrumentationSpecTestClass' , methodName : 'long_test_method' } ,
535+ segments : segments ,
536+ }
537+ end
538+
523539 it 'substitutes the expected value' do
524540 probe_manager . add_probe ( probe )
525541
@@ -535,7 +551,7 @@ def run_test
535551 expect ( value ) . to be > 0
536552 expect ( value ) . to be < 1
537553 end
538- expect ( InstrumentationSpecTestClass . new . test_method ) . to eq ( 42 )
554+ expect ( InstrumentationSpecTestClass . new . long_test_method ) . to eq ( 42 )
539555 component . probe_notifier_worker . flush
540556 end
541557 end
You can’t perform that action at this time.
0 commit comments