# Echo command failing when run the test

**URL:** <https://forum.codecrafters.io/t/echo-command-failing-when-run-the-test/3921>\
**Category:** Bug Reports\
**Tags:** challenge:shell\
**Created:** [January 3, 2025, 4:04pm UTC](https://forum.codecrafters.io/t/echo-command-failing-when-run-the-test/3921 "2025-01-03T16:04:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![R1zwan](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/r1zwan/32/3713_2.png) [@R1zwan](https://forum.codecrafters.io/u/R1zwan)\
**Post date:** [January 3, 2025, 4:04pm UTC](https://forum.codecrafters.io/t/echo-command-failing-when-run-the-test/3921/1 "2025-01-03T16:04:07Z")

</div>

Not sure why the test script is including command with arguments?  
The above echo command passed but random echo command fails?

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/f/fbd1da15c8b45f8d023e52e0719d3909fb4e0cfc.png)

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [January 3, 2025, 6:19pm UTC](https://forum.codecrafters.io/t/echo-command-failing-when-run-the-test/3921/2 "2025-01-03T18:19:41Z")

</div>

I’ll take a look shortly.

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [January 3, 2025, 8:43pm UTC](https://forum.codecrafters.io/t/echo-command-failing-when-run-the-test/3921/3 "2025-01-03T20:43:27Z")

</div>

Hi @R1zwan, I tried running your code against the previous stages, but it’s actually no longer passing the second stage **#CZ2 (Handle invalid commands)**.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/f/ff3e6d64c05aefc10494877b202ee10861323002.png)

Suggestions:

1. Use [our CLI](https://docs.codecrafters.io/cli/installation) to test against previous stages by running:

```auto
codecrafters test --previous

```

1. Focus on fixing the early stages first, as later stages depend on them.

---

<div class="post-metadata">

**Author:** ![R1zwan](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/r1zwan/32/3713_2.png) [@R1zwan](https://forum.codecrafters.io/u/R1zwan)\
**Post date:** [January 5, 2025, 7:32am UTC](https://forum.codecrafters.io/t/echo-command-failing-when-run-the-test/3921/4 "2025-01-05T07:32:20Z")

</div>

> [@andy1li](#):
>
> `--previous`

Hi Andy,

Thanks for pointing out the issues in previous stages. I have fixed them. But the original issue remain as it is. the cli is printing the input command twice.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/e/e3f1a42cacc85bcfe1a6db248dc17e6bca2c8e2d.png)

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/9/9786c983e59184fc77c573c2592332b1b8e562c2.png)

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [January 5, 2025, 6:43pm UTC](https://forum.codecrafters.io/t/echo-command-failing-when-run-the-test/3921/6 "2025-01-05T18:43:40Z")

</div>

@R1zwan, this might be an issue on our own end. We’ll investigate it and keep you updated on any progress.

---

<div class="post-metadata">

**Author:** ![R1zwan](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/r1zwan/32/3713_2.png) [@R1zwan](https://forum.codecrafters.io/u/R1zwan)\
**Post date:** [January 5, 2025, 7:38pm UTC](https://forum.codecrafters.io/t/echo-command-failing-when-run-the-test/3921/8 "2025-01-05T19:38:12Z")

</div>

Thank you.

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [January 6, 2025, 5:59pm UTC](https://forum.codecrafters.io/t/echo-command-failing-when-run-the-test/3921/9 "2025-01-06T17:59:11Z")

</div>

This bug is turning to be very interesting – the behavior is real, i.e. it isn’t a tester bug, the extra print is ACTUALLY happening. The bug only happens intermittently, and it is unique to C# programs. Other users are running into this too, but all of them are using C#.

We came up with [a workaround](https://github.com/codecrafters-io/shell-tester/pull/93) that @ryan-gang will deploy shortly and test, and try to open a C# bug report once we’re able to work on reproducing this outside of our test framework. We’ll share the report here if we’re able to come up with a good minimal repo.

In the 3 years we’ve been running CodeCrafters, this seems like the one case where “It’s never a compiler bug” is not going to be true 😃

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [January 13, 2025, 5:59pm UTC](https://forum.codecrafters.io/t/echo-command-failing-when-run-the-test/3921/10 "2025-01-13T17:59:49Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
