bugGNU Octave - Bugs: bug #67613, [octave forge] (instrument...

 
 

bug #67613: [octave forge] (instrument control) Non-reproducible unit test depending on timeout

Submitter:  Rafael Laboissière <rlaboiss>
Submitted:  Sat 18 Oct 2025 12:52:35 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Patch Submitted Assigned to:  lostbard
Originator Name:  Open/Closed:  * Open
Release:  * other Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Mon 20 Oct 2025 10:30:43 PM UTC, comment #3: 

looks good to me - i'll apply to instrument-control when I get a spare few

John Donoghue <lostbard>
Group Member
Mon 20 Oct 2025 03:23:17 PM UTC, comment #2: 

Thanks for your reply.

Please, find attached to this message the patch that I am currently applying to the Debian package octave-instrument-control.

(file #57731)

Rafael Laboissière <rlaboiss>
Mon 20 Oct 2025 11:13:41 AM UTC, comment #1: 

Yeah I believe the timeout will always be at least the timeout value.


John Donoghue <lostbard>
Group Member
Sat 18 Oct 2025 12:52:35 PM UTC, original submission:  

While building the octave-instrument-control package, I encountered this failure in one of the unit tests:


[src/udp/udp_read.cc]
>>>>> /var/data/rlaboiss/debian/PKGS/octave-instrument-control/octave-instrument-control/src/udp/udp_read.cc
***** test
 a = udp ();
 assert (! isnull (a));
 [d,c] = udp_read (a, 1, 0);
 assert (c == 0);
 assert (isempty (d));
 udp_close (a);
***** error <Invalid call to udp_read> udp_read(1, 10, 0)
***** test
 a = udp ();
 fail ("udp_read (a, 10, 0, 0)", "Invalid call to udp_read");
 udp_close (a);
***** test
 # does read wait
 a = udp ();
 assert (! isnull (a));
 tic;
 [d,c] = udp_read (a, 1, 1000);
 t = toc;
 assert (c, 0);
 assert (isempty (d));
 assert (t, 1.0, 0.1)
 udp_close (a);
!!!!! test failed
ASSERT errors for:  assert (t,1.0,0.1)

  Location  |  Observed  |  Expected  |  Reason
     ()         1.1335         1         Abs err 0.13348 exceeds tol 0.1 by 0.03
4 tests, 3 passed, 0 known failure, 0 skipped


The third argument in the udp_read function call is the timeout (1000 ms, in the case above). Since nobody is answering to the call, udp_read times out and the value of t taken from toc should be closer to 1.0. This is what is expected with the test "assert (t, 1.0, 0.1)". However, this went wrong in my building because some external process should have delayed the call to toc.

I think that a more appropriate test would be:


assert (t >= 1.0)


What do you think?

Rafael Laboissière <rlaboiss>

 

Attached Files

Attached Files
file #57731:  assert-timeout.patch added by rlaboiss (1.4KiB - text/x-patch)

(Note: upload size limit is set to 16MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by rlaboiss (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    History

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-10-20 lostbard Assigned tokahacjde lostbard
    2025-10-20 lostbard StatusNone Patch Submitted
        Assigned toNone kahacjde
    2025-10-20 rlaboiss Attached File- Added assert-timeout.patch, #57731

    Back to the top

    Powered by Savane 3.16.
    Corresponding source code