[ 
https://issues.apache.org/jira/browse/DISPATCH-1783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17378606#comment-17378606
 ] 

ASF GitHub Bot commented on DISPATCH-1783:
------------------------------------------

jiridanek commented on pull request #1292:
URL: https://github.com/apache/qpid-dispatch/pull/1292#issuecomment-877771444


   The benchmark library automatically adjusts number of iterations of each 
test based on iteration duration and on the variance of previous iteration 
durations. On GHA that seems to translate to runtime of between 6 to 60 seconds 
for the single test I have there.
   
   This is obviously unacceptably too long going forward. I would not be too 
hard to split the benchmarks to a separate job and that then gives ~10 minute 
budget to run (similar to other test jobs). Running the benchmarks without ASan 
would help to speed it up and make the result more relevant (for performance), 
too. For now, this PR sets short min_time for the benchmark, so it only runs 
just about once. Enough to check it is capable of running, does not trigger 
ASan errors, and that the measured time is not way too outlandish.
   
   
https://github.com/apache/qpid-dispatch/runs/3039601651?check_suite_focus=true#step:9:4704
   
   ```
   76: Test command: /usr/bin/bwrap "--bind" "/" "/" "--unshare-net" "--dev" 
"/dev" "--die-with-parent" "--" 
"/opt/hostedtoolcache/Python/3.7.10/x64/bin/python3.7" 
"/home/runner/work/qpid-dispatch/qpid-dispatch/qpid-dispatch/build/tests/run.py"
 
"/home/runner/work/qpid-dispatch/qpid-dispatch/qpid-dispatch/build/tests/c_benchmarks/c-benchmarks"
 "--benchmark_min_time=0.001"
   76: Test timeout computed to be: 1200
   76: 2021-07-11 09:47:42
   76: Running 
/home/runner/work/qpid-dispatch/qpid-dispatch/qpid-dispatch/build/tests/c_benchmarks/c-benchmarks
   76: Run on (2 X 2294.69 MHz CPU s)
   76: CPU Caches:
   76:   L1 Data 32K (x2)
   76:   L1 Instruction 32K (x2)
   76:   L2 Unified 256K (x2)
   76:   L3 Unified 51200K (x1)
   76: Load Average: 2.30, 1.65, 0.79
   76: 
---------------------------------------------------------------------------
   76: Benchmark                                 Time             CPU   
Iterations
   76: 
---------------------------------------------------------------------------
   76: BM_RouterInitializeMinimalConfig        371 ms         4.25 ms           
 1
   76: -----------------------------------------------------
   76: Suppressions used:
   76:   count      bytes template
   76:       1         56 ^IoAdapter_init$
   76:      10       5456 ^_PyObject_Realloc
   76:     533     852035 ^PyObject_Malloc$
   76:       1         32 ^PyThread_allocate_lock$
   76:       4       9897 ^PyMem_Malloc$
   76:       2       1528 ^_PyObject_GC_Resize$
   76: -----------------------------------------------------
   76: 
   37/38 Test #76: c-benchmarks ......................................   Passed 
   0.73 sec
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


> Add ability to use test doubles (mocks, fakes, ...) in C tests
> --------------------------------------------------------------
>
>                 Key: DISPATCH-1783
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1783
>             Project: Qpid Dispatch
>          Issue Type: Improvement
>          Components: Tests
>    Affects Versions: 1.14.0
>            Reporter: Jiri Daněk
>            Priority: Major
>
> During the work on https://github.com/apache/qpid-dispatch/pull/684, there 
> was at one point a version of the PR, which tested what happens if 
> {{vsnprintf}} called from {{safe_snprinf}} returns {{-1}}.
> This was done by replacing the {{vsnprintf}} with a mock (technically it's 
> probably a stub, or maybe fake, but let's ignore the proper terminology).
> There are various possibilities how to approach mocking in C. They are less 
> nice than in more dynamic languages such as Java, or even C++ (where it's 
> possible to subclass things). Nevertheless, it can be useful technique, and 
> it should be explored.
> CC [~cans]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to