100-exercises-to-learn-rust icon indicating copy to clipboard operation
100-exercises-to-learn-rust copied to clipboard

(07) threads - (05) channels will not pass

Open afresquet opened this issue 1 year ago • 4 comments

Exercise (07) threads - (05) channels won't pass for me even when using the solution in the solutions branch.

Error:

        ❌ (07) threads - (05) channels

        Meditate on your approach and return. Mountains are merely mountains.



error: test failed, to rerun pass `--test insert`

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 2 tests
ready --- FAILED
.
failures:

---- ready stdout ----
thread 'ready' panicked at exercises/07_threads/05_channels/tests/insert.rs:31:5:
assertion failed: move_forward
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    ready

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.20s

Error with RUST_BACKTRACE=1:

        ❌ (07) threads - (05) channels

        Meditate on your approach and return. Mountains are merely mountains.



error: test failed, to rerun pass `--test insert`

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 2 tests
ready --- FAILED
.
failures:

---- ready stdout ----
thread 'ready' panicked at exercises/07_threads/05_channels/tests/insert.rs:31:5:
assertion failed: move_forward
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:145:5
   3: insert::ready
             at ./tests/insert.rs:31:5
   4: insert::ready::{{closure}}
             at ./tests/insert.rs:22:11
   5: core::ops::function::FnOnce::call_once
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/ops/function.rs:250:5
   6: core::ops::function::FnOnce::call_once
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    ready

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.20

afresquet avatar May 24 '24 18:05 afresquet

Same for me. I have to change this variable to true:

https://github.com/mainmatter/100-exercises-to-learn-rust/blob/38dea384537077225888f3487be83501386cd851/exercises/07_threads/05_channels/tests/insert.rs#L29

Maybe this could be a little more explicit in the todo?

Nowheresly avatar May 25 '24 10:05 Nowheresly

IMHO it was pretty clear. But I guess I did go look at the test to see what I needed to do so I already knew it was there. I feel it is good to help students remember to look at the test to see what is wrong.

c-git avatar May 26 '24 12:05 c-git

It is pretty clear once you read the test, but if I'm not mistaken it was the first time I ran into an exercise that required looking at the tests. After that it became more common and/or indicated in the exercise's comments.

afresquet avatar May 26 '24 12:05 afresquet

yep it was the first one you had to but I guess I kinda always looked at the test to see how test would have been written. I agree maybe pointing students to go check the tests might be good but I also wonder if they possibly getting stuck might add value. Maybe the "fix" might be to update the failed test error message to be more clear. Like add a message in addition to the assert failing like

assert!(move_forward, "If you think you're done see test for more info");

c-git avatar May 26 '24 12:05 c-git

it was the first time I ran into an exercise that required looking at the tests

Almost every exercise requires checking out the tests to see what's expected. I have added a TODO at the top of the file to make it easier to spot that something needs to be done there.

LukeMathWalker avatar May 28 '24 09:05 LukeMathWalker