Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [stdlib] [collections] [list] List test sometimes fails sometimes doesn't in nightly 2024.5.1805 #2738

Closed
martinvuyk opened this issue May 18, 2024 · 2 comments
Labels
bug Something isn't working mojo-repo Tag all issues with this label

Comments

@martinvuyk
Copy link
Contributor

martinvuyk commented May 18, 2024

Bug description

******************** TEST 'Mojo Standard Library :: collections/test_list.mojo' FAILED ********************
Exit Code: 1
 
Command Output (stdout):
--
Unhandled exception caught during execution: AssertionError: Didn't raise at /Users/runner/work/mojo/mojo/stdlib/test/collections/test_list.mojo:414:23
 
--
Command Output (stderr):
--
RUN: at line 13: mojo /Users/runner/work/mojo/mojo/stdlib/test/collections/test_list.mojo
+ mojo /Users/runner/work/mojo/mojo/stdlib/test/collections/test_list.mojo
mojo: error: execution exited with a non-zero result: 1
 
--
 
********************

Line 414 is the last assert

    var test_list_a = List[Int](10, 20, 30, 40, 50)

    # Basic Functionality Tests
    assert_equal(test_list_a.index(10), 0)
    assert_equal(test_list_a.index(30), 2)
    assert_equal(test_list_a.index(50), 4)
    with assert_raises(contains="ValueError: Given element is not in list"):
        _ = test_list_a.index(60)

    # Tests With Start Parameter
    assert_equal(test_list_a.index(30, start=1), 2)
    assert_equal(test_list_a.index(30, start=-4), 2)
    with assert_raises(contains="ValueError: Given element is not in list"):
        _ = test_list_a.index(30, start=3)
    with assert_raises(contains="ValueError: Given element is not in list"):
        _ = test_list_a.index(30, start=5)

    # Tests With Start and End Parameters
    assert_equal(test_list_a.index(30, start=1, stop=3), 2)
    assert_equal(test_list_a.index(30, start=-4, stop=-2), 2)
    with assert_raises(contains="ValueError: Given element is not in list"):
        _ = test_list_a.index(30, start=1, stop=2)
    with assert_raises(contains="ValueError: Given element is not in list"):
        _ = test_list_a.index(30, start=3, stop=1)

    # Tests With End Parameter Only
    assert_equal(test_list_a.index(30, stop=3), 2)
    assert_equal(test_list_a.index(30, stop=-2), 2)
    with assert_raises(contains="ValueError: Given element is not in list"):
        _ = test_list_a.index(30, stop=1)
    with assert_raises(contains="ValueError: Given element is not in list"):
        _ = test_list_a.index(30, stop=2)
    with assert_raises(contains="ValueError: Given element is not in list"):
        _ = test_list_a.index(60, stop=50)

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected.
  • If applicable, add screenshots to help explain the problem.
  • If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
  • Include anything else that might help us debug the issue.

System information

- What OS did you do install Mojo on ?
- Provide version information for Mojo by pasting the output of `mojo -v`
`mojo 2024.5.1805`
- Provide Modular CLI version by pasting the output of `modular -v`
@martinvuyk martinvuyk added bug Something isn't working mojo-repo Tag all issues with this label labels May 18, 2024
@martinvuyk martinvuyk changed the title [BUG] List test sometimes fails sometimes doesn't in nightly 2024.5.1805 [BUG] [stdlib] [collections] [list] List test sometimes fails sometimes doesn't in nightly 2024.5.1805 May 18, 2024
@gabrieldemarmiesse
Copy link
Contributor

I think it's going to be fixed by #2745 but I'm not completely sure

@martinvuyk
Copy link
Contributor Author

I think it's going to be fixed by #2745 but I'm not completely sure

looks like that is the root cause, just let me know when it's merged and I'll close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

2 participants