Amber icon indicating copy to clipboard operation
Amber copied to clipboard

[BUG] Continuous integration sometimes generates false "test failed" notifications

Open hdwalters opened this issue 1 year ago • 3 comments

I recently received a random "Cargo & Clippy Test" email on my glob function branch, directing me to https://github.com/amber-lang/amber/actions/runs/10872830349/job/30168293449. This complains about a failed unit test, which I haven't touched:

---- tests::stdlib::test_stdlib_src_tests_stdlib_abs_ab stdout ----
thread 'tests::stdlib::test_stdlib_src_tests_stdlib_abs_ab' panicked at src/tests/mod.rs:18:28:
assertion `left == right` failed
  left: ""
 right: "1\n1"

I do not see how this unit test could possibly fail, as it doesn't access the file system or anything else external:

$ cat src/tests/stdlib/abs.ab 
import * from "std/math"

// Output 
// 1
// 1

main {
    echo abs(1);
    echo abs(-1);
}

hdwalters avatar Sep 16 '24 18:09 hdwalters

probably related to bash version

b1ek avatar Sep 17 '24 07:09 b1ek

probably related to bash version

If that were the problem, surely it would succeed or fail consistently? I would expect the CI server to do something like spinning up a Docker instance, to run tests in a consistent environment.

hdwalters avatar Sep 17 '24 17:09 hdwalters

So it is a bug that happens sometimes. Re run the jobs fixes it, I think that https://github.com/amber-lang/amber/pull/381 could fix it but that PR is blocked because there is an issue in escaping with bash generated.

Mte90 avatar Sep 23 '24 09:09 Mte90

I think that now postprocessor was fixed this issue is gone. Just keep the ticket open for a while to close it later.

Mte90 avatar Nov 12 '24 09:11 Mte90

I think that now postprocessor was fixed this issue is gone. Just keep the ticket open for a while to close it later.

Please don't close it just yet; it seems to be an intermittent problem. I've occasionally had test failures on my own PC when I run cargo test, but these go away if I run cargo build first, especially when I'm switching Git branches.

hdwalters avatar Nov 12 '24 18:11 hdwalters

Also, surely the absence of a postprocessor binary on the CI server would not cause intermittent failures as described above; it would either always succeed, or always fail.

hdwalters avatar Nov 13 '24 20:11 hdwalters

can we close this? I don't see anymore the issue

Mte90 avatar Dec 23 '24 13:12 Mte90

It still occurs intermittently for me, though in different circumstances; but I have no idea why. I guess you can close the issue if it's not going to get investigated.

hdwalters avatar Dec 23 '24 19:12 hdwalters

I think that is the case to close it, I am not able to replicate it in my machine and in the official CI.

Mte90 avatar Dec 24 '24 10:12 Mte90