Zulip Chat Archive

Stream: mathlib4

Topic: Obscure test fail


Yaël Dillies (Nov 22 2023 at 18:46):

Can somebody help me understand what went wrong in https://github.com/leanprover-community/mathlib4/actions/runs/6959383845/job/18936498084 ? I don't understand the logs (or rather what's expected and what's not), nor why any of my PR would have made the test suite fail.

Yaël Dillies (Nov 22 2023 at 18:50):

It seems the failing file is test.LibrarySearch.basic, but I can't reproduce locally. @Scott Morrison, since you authored most of the file, any idea?

Kyle Miller (Nov 22 2023 at 19:20):

(this is PR #7712)

Damiano Testa (Nov 22 2023 at 20:43):

I think that tests have been silenced recently: I wonder whether this has something to do with that.

Damiano Testa (Nov 22 2023 at 20:54):

Some tests are not quiet on your branch:

test/SimpRw.lean
test/SimpRw.lean:37:0: warning: declaration uses 'sorry'

test/apply_fun.lean
test/apply_fun.lean:271:2: warning: this tactic is never executed [linter.unreachableTactic]

test/convert2.lean
test/convert2.lean:10:2: warning: this tactic is never executed [linter.unreachableTactic]
test/convert2.lean:11:2: warning: this tactic is never executed [linter.unreachableTactic]

test/norm_cast.lean
test/norm_cast.lean:143:9: warning: unused variable `h` [linter.unusedVariables]

Ironically, I do not think that the culprit is LibrarySearch.

Yaël Dillies (Nov 22 2023 at 20:56):

Yes, but... why?

Damiano Testa (Nov 22 2023 at 20:59):

I don't know: the files on your branch look identical to the ones on master...

Damiano Testa (Nov 22 2023 at 21:00):

However, I am pretty sure that it is the script in GNUmakefile that is responsible for the failure.

Damiano Testa (Nov 22 2023 at 21:07):

In fact, the files appear to be noisy on master as well.

Damiano Testa (Nov 22 2023 at 21:13):

If you look at current master, the tests fail, but CI passes anyway.

Damiano Testa (Nov 22 2023 at 21:14):

Maybe the failure is enough to get the branch CI complain, but not the one of master? :shrug:

The PR was #8438.

Ruben Van de Velde (Nov 22 2023 at 21:21):

Oh I see it, I think

Ruben Van de Velde (Nov 22 2023 at 21:21):

    lake env lean test/$* > test/$*.log
    @if [ -s test/$*.log ]; then \
        echo "Error: Test output is not empty"; \
        cat test/$*.log; \
        rm -f test/$*.log \
        exit 1; \
    fi
    @rm -f test/$*.log

Damiano Testa (Nov 22 2023 at 21:21):

Is it the exit instead of return?

Ruben Van de Velde (Nov 22 2023 at 21:22):

It's trying to rm a file called exit because there's no semicolon

Ruben Van de Velde (Nov 22 2023 at 21:22):

@Scott Morrison

Ruben Van de Velde (Nov 22 2023 at 21:23):

But then why is it failing for @Yaël Dillies

Damiano Testa (Nov 22 2023 at 21:24):

Something is weird, but very good catch with the ;.

Ruben Van de Velde (Nov 22 2023 at 21:24):

Maybe the test is actually failing? Or crashing?

Ruben Van de Velde (Nov 22 2023 at 21:25):

And the output thing is just a red herring

Damiano Testa (Nov 22 2023 at 21:26):

On master and on Yaël PR the test files are identical, they also fail on master, but CI is happy with the errors...

Damiano Testa (Nov 22 2023 at 21:27):

On my computer, rm -f nonexistentfile does nothing with exit code 0.

Kyle Miller (Nov 22 2023 at 21:27):

Yeah, I was about to mention that.

Damiano Testa (Nov 22 2023 at 21:28):

But maybe, the computers where the branch CIs and the master CI run have different options?

Kyle Miller (Nov 22 2023 at 21:30):

Thanks for catching that semicolon @Ruben Van de Velde : #8580

Damiano Testa (Nov 22 2023 at 21:31):

As far as I can tell, rm has a non-zero exit code almost exclusively if it is trying to remove a file that cannot be deleted due to issues with permissions.

Damiano Testa (Nov 22 2023 at 21:31):

Maybe the "user" running the two CIs, on master and on CIs, have different permissions? I am really not sure.

Damiano Testa (Nov 22 2023 at 21:32):

Kyle Miller said:

Thanks for catching that semicolon Ruben Van de Velde : #8580

Still not passing the tests! How ironic...

Kyle Miller (Nov 22 2023 at 21:32):

rm seems to be unrelated to the noisy tests error. I'm seeing test/norm_cast.lean for example having an unused variable locally

Damiano Testa (Nov 22 2023 at 21:33):

Oh yes, there are 4 test files that are noisy.

Ruben Van de Velde (Nov 22 2023 at 21:33):

Damiano Testa said:

Kyle Miller said:

Thanks for catching that semicolon Ruben Van de Velde : #8580

Still not passing the tests! How ironic...

Tests that don't run in CI fail, that's pretty much a given :)

Ruben Van de Velde (Nov 22 2023 at 21:34):

test/convert2.lean:10:2: warning: this tactic is never executed [linter.unreachableTactic]
test/convert2.lean:11:2: warning: this tactic is never executed [linter.unreachableTactic]
test/apply_fun.lean:271:2: warning: this tactic is never executed [linter.unreachableTactic]
test/norm_cast.lean:143:9: warning: unused variable `h` [linter.unusedVariables]
test/SimpRw.lean:37:0: warning: declaration uses 'sorry'

Kyle Miller (Nov 22 2023 at 21:35):

I guess I'll just silence these tests and add the fixes to the PR

Damiano Testa (Nov 22 2023 at 21:35):

Those same files are noisy on master as well.

Damiano Testa (Nov 22 2023 at 21:39):

One day, there will be a formally verified CI...

Kyle Miller (Nov 22 2023 at 21:39):

I've noticed strange things with linter errors becoming noisy on my own branches before, especially the unused variable linter. Not in tests, but inside theory files.

Kyle Miller (Nov 22 2023 at 22:12):

Ok, #8580 managed to silence the tests, and Damiano put it on the maintainer merge queue.

Scott Morrison (Nov 23 2023 at 00:02):

My apologies about the missing semicolon. :-(

Patrick Massot (Nov 23 2023 at 00:19):

I guess you are contractually forced to do propaganda in favor of white-space sensitivity instead of end of line marks.

Damiano Testa (Nov 23 2023 at 00:38):

It is not clear that the semicolon was the issue though. The tests still failed with the semicolon added. They only stopped failing when Kyle silenced them.

Yaël Dillies (Nov 23 2023 at 13:37):

It still fails, it seems: https://github.com/leanprover-community/mathlib4/actions/runs/6966936788/job/18957910162 :sad:

Ruben Van de Velde (Nov 23 2023 at 13:40):

Have you tried bisecting which changes are causing the failure?

Damiano Testa (Nov 23 2023 at 13:41):

Is that stray .run after what looks like a lean file-path correct? I'm on mobile, so limited capabilities!

Ruben Van de Velde (Nov 23 2023 at 13:42):

Yeah, that's the make target, that's fine

Yaël Dillies (Nov 23 2023 at 13:47):

Sorry no I haven't. I'm already overtime on Lean stuff and I don't want the police (my director of studies) to find out.

Yaël Dillies (Nov 24 2023 at 19:28):

Happening again: https://github.com/leanprover-community/mathlib4/actions/runs/6978507007/job/18990033890

Yaël Dillies (Nov 24 2023 at 19:28):

Is it hitting just me somehow?

Ruben Van de Velde (Nov 24 2023 at 20:46):

Wait, on a completely different pr? Do they have anything in common?

Yaël Dillies (Nov 24 2023 at 20:53):

They touch the same files.

Damiano Testa (Nov 24 2023 at 21:34):

Do your PRs include a file in test with extension .log? :rofl:

Ruben Van de Velde (Nov 27 2023 at 14:05):

#7810 hit this too - should we disable the test?

Kyle Miller (Nov 27 2023 at 19:16):

I don't understand why it doesn't print "Error: Test output is not empty" or the output, unless lean itself causing the makefile to exit?

Eric Wieser (Nov 27 2023 at 19:53):

Should be be teeing the file instead so that we actually see any errors?

Yaël Dillies (Nov 29 2023 at 13:06):

Could we come to a conclusion? This is blocking my PRs with no actionable solution from my part.

Mauricio Collares (Nov 29 2023 at 13:31):

Eric Wieser said:

Should be be teeing the file instead so that we actually see any errors?

Yes, that's a good idea. As Kyle mentioned, lean itself returns 1 in case #guard_msgs sees an unexpected message.

Mauricio Collares (Nov 29 2023 at 13:36):

I guess we should enable a Makefile pipefail equivalent (if it exists) so we don't lose Lean's exit code, though.

Eric Wieser (Nov 29 2023 at 14:41):

#8716

Eric Wieser (Nov 30 2023 at 13:53):

I can confirm this fixed the issue, and now the actual failure message can be seen again

Notification Bot (Nov 30 2023 at 15:19):

4 messages were moved from this topic to #mathlib4 > exact? test failure: le_antisymm vs ge_antisymm by Eric Wieser.

Scott Morrison (Dec 01 2023 at 03:37):

I'm not sure how exact? could be nondeterministic here, or how these changes could have affected exact?, sorry.

Scott Morrison (Dec 01 2023 at 03:37):

Remove the offending test??


Last updated: Dec 20 2023 at 11:08 UTC