Bug 264856 - devel/bmake: Fails unit test deptgt-interrupt
Summary: devel/bmake: Fails unit test deptgt-interrupt
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Mikolaj Golub
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-23 18:04 UTC by metaqwe
Modified: 2022-07-07 06:27 UTC (History)
2 users (show)

See Also:


Attachments
poudriere bulk log of devel/bmake (32.80 KB, text/plain)
2022-06-23 18:04 UTC, metaqwe
no flags Details
devel/bmake: don't run tests on build (3.51 KB, patch)
2022-06-29 05:59 UTC, Mikolaj Golub
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description metaqwe 2022-06-23 18:04:14 UTC
Created attachment 234899 [details]
poudriere bulk log of devel/bmake

devel/bmake fails unit test deptgt-interrupt
Comment 1 Mikolaj Golub freebsd_committer freebsd_triage 2022-06-24 14:31:16 UTC
Is it reproducible on every run or just sporadic? Because I have failed to reproduce it locally so far.
Comment 2 metaqwe 2022-06-27 21:19:11 UTC
(In reply to Mikolaj Golub from comment #1)
Yes, after jail rebuild, no ccache, still fails, but I must be missing something. I will accept whatever you decide, of course.
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2022-06-28 17:03:35 UTC
The unit test is defective and will always be flaky.  There is no guarantee that the SIGINT reaches the shell process before it exits, and especially under load it is very likely that it doesn't.  So there's no guarantee that Ctrl-C will always be output.

The test can be improved slightly by adding a sleep to the test, giving the system some time to deliver the signal:

 all:
 	@kill -INT ${.MAKE.PID}
+	@sleep 10
 
 .INTERRUPT:
 	@echo 'Ctrl-C'

Though I'd recommend just disabling the unit test or not making its failure fail the build.  I don't understand why we are running the units tests on build anyway.  There's a dedicated test target for that.

(just had a build failure on armv7 13.1 with this test)
Comment 4 Mikolaj Golub freebsd_committer freebsd_triage 2022-06-29 05:59:20 UTC
Created attachment 234990 [details]
devel/bmake: don't run tests on build

I am going to disable test run on build and provide "test" target instead as it is in the attached patch.
Comment 5 Robert Clausecker freebsd_committer freebsd_triage 2022-06-29 13:01:33 UTC
Sounds good!
Comment 6 commit-hook freebsd_committer freebsd_triage 2022-06-30 07:19:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=69f9eae5417aaf7156c499741a46512e05d4c62d

commit 69f9eae5417aaf7156c499741a46512e05d4c62d
Author:     Mikolaj Golub <trociny@FreeBSD.org>
AuthorDate: 2022-06-29 05:51:49 +0000
Commit:     Mikolaj Golub <trociny@FreeBSD.org>
CommitDate: 2022-06-30 07:18:10 +0000

    devel/bmake: don't run tests on build

    Some tests are unreliable and we were fighting them by just
    disabling.

    So instead of running tests on build, provide "test" target. And
    now we may remove the patches that disabled failing tests.

    PR:             264856

 devel/bmake/Makefile                               | 11 ++++---
 .../files/extrapatch-unit-tests_Makefile (gone)    | 11 -------
 devel/bmake/files/patch-boot-strap (new)           | 12 ++++++++
 devel/bmake/files/patch-unit-tests_Makefile (gone) | 36 ----------------------
 4 files changed, 18 insertions(+), 52 deletions(-)
Comment 7 metaqwe 2022-06-30 08:02:18 UTC
Succeeds for me. Thanks.