← 输入框|github.com|刷新
Skip to content

test random failed #2542

Closed
Closed

Description

@certik
167/325 Test #174: test_random_02 ...................***Failed    0.12 sec
0.7547386333122814 0.7539588431983508
Traceback (most recent call last):
  File "/home/runner/work/lpython/lpython/integration_tests/test_random_02.py", line 11, in <module>
    test_seed()
  File "/home/runner/work/lpython/lpython/integration_tests/test_random_02.py", line 9, in test_seed
    assert abs(t1 - t2) > 1e-3
           ^^^^^^^^^^^^^^^^^^^
AssertionError

https://github.com/lcompilers/lpython/actions/runs/7939986580/job/21680720142?pr=2540

Activity

  1. certik commented on Feb 17, 2024

    @certik
    ContributorAuthor

    The test is flaky:

    assert abs(t1 - t2) > 1e-3
    , one can't test random numbers like that.

    I thought we already tackled this issue before with @Shaikh-Ubaid in LFortran. One must test random numbers using tests designed for random numbers: they pass with very high probability (=every time in practice). The above test is low probability, that one can even trigger a failure at a CI. So that's a bad test. We need to improve it.

  2. ubaidsk commented on Feb 17, 2024

    @ubaidsk
    Collaborator

    A good test exists in LFortran. The test in LPython was more for completeness or as measure of extra safety.

    Since, it already has tests in LFortran, do we still need to add a similar test for LPython?

  3. certik commented on Feb 17, 2024

    @certik
    ContributorAuthor

    Just test it in some way that is robust in LPython as well, to ensure that everything works.

  4. syheliel commented on Feb 18, 2024

    @syheliel
    Contributor

    I have added a PR for it. The new testcase's aim is to test whther the distribution is uniform. I think it's a more valuable test compared to original version

  5. certik commented on Feb 18, 2024

    @certik
    ContributorAuthor

    I think this is fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions