Skip to content

[ignore] Verbose output for faster troubleshooting of test problems #467

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

Closed
wants to merge 0 commits into from

Conversation

NorseGaud
Copy link
Contributor

@NorseGaud NorseGaud commented Jul 19, 2021

#137 seems to be dead.

Goal: Provide a better way to see exactly what was run and any STDERR/OUT for the commands

@NorseGaud NorseGaud requested a review from a team as a code owner July 19, 2021 18:19
Copy link
Member

@martin-schulze-vireso martin-schulze-vireso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is somewhat similar to the trace PR. I like the idea of having a separate log file but there may be situations where we warnt the output in the test result.

My suggestion would to have two options --trace and --trace-log to decide where the output goes.

Alternatively we could add FD 4 that is meant for trace output an can be redirected/merged at will. I'd have to think a bit about this.

@martin-schulze-vireso
Copy link
Member

I am wondering if it is worthwhile to separate the output for each test into its own file. This would make it easier to find the interesting parts.

@NorseGaud
Copy link
Contributor Author

I am wondering if it is worthwhile to separate the output for each test into its own file. This would make it easier to find the interesting parts.

Absolutely! And, it would allow us to cat just the failing test file?

I am wondering if it is worthwhile to separate the output for each test into its own file. This would make it easier to find the interesting parts.

It would allow for targetting the specific file to cat should it fail or the config set success STDOUT to be shown. I like that idea.

@NorseGaud NorseGaud changed the title --log : STDOUT/ERR of commands being run to log file --trace <level> : show command and STDOUT/ERR in terminal Jul 20, 2021
@NorseGaud
Copy link
Contributor Author

@martin-schulze-vireso , is there a way to allow contributors to cancel actions jobs that they started? I generated a bunch and want to kill them all.

@NorseGaud NorseGaud force-pushed the master branch 2 times, most recently from 01a075e to 3bfae55 Compare July 20, 2021 01:35
@martin-schulze-vireso
Copy link
Member

I don't think so. If you want full control, you should work with a private branch in your fork.

@NorseGaud NorseGaud mentioned this pull request Jul 22, 2021
2 tasks
@martin-schulze-vireso martin-schulze-vireso added Component: Bash Code Everything regarding the bash code Priority: High Broken behavior in specific environments like in parallel mode or only on some operating systems Type: Enhancement labels Jul 23, 2021
@martin-schulze-vireso martin-schulze-vireso added this to the 1.5.0 milestone Jul 23, 2021
@peternewman
Copy link
Contributor

Since #137 seems to be dead and honestly isn't really a critically/urgently needed feature for users of bats (many of which I know personally)

I'm unclear of the exact difference between these PRs, but I've been stuck a few times trying to add or extend tests using BATS and really struggled due to the lack of easy way to debug what's going on, am I matching slightly the wrong output, is me calling it via BATS generating slightly different output, is my BATS test broken, or something else? Having to run the command standalone and in BATS and update both when debugging stuff is a real faff. A number of these PRs have stalled at this point, as the pain is too much and I've just gone onto other things.

I am wondering if it is worthwhile to separate the output for each test into its own file. This would make it easier to find the interesting parts.

It would allow for targetting the specific file to cat should it fail or the config set success STDOUT to be shown. I like that idea.

FWIW from my experience with other CI, what I actually want is to see the debug info if the test run fails. E.g. with Travis CI with both configure and make check, I have on fail bits of the config that cat config.log test-suite.log respectively if the build fails, ideally I, or particularly a contributor, don't want to have to tweak the CI each time there's a failure, so some easy way to cat just the failing files would be great, either only writing them to disk if a test failed, or something built in which outputs all of a failed test just before BATS dies.

Thanks for this though, I'm really looking forward to it!

@NorseGaud
Copy link
Contributor Author

Since #137 seems to be dead and honestly isn't really a critically/urgently needed feature for users of bats (many of which I know personally)

I'm unclear of the exact difference between these PRs, but I've been stuck a few times trying to add or extend tests using BATS and really struggled due to the lack of easy way to debug what's going on, am I matching slightly the wrong output, is me calling it via BATS generating slightly different output, is my BATS test broken, or something else? Having to run the command standalone and in BATS and update both when debugging stuff is a real faff. A number of these PRs have stalled at this point, as the pain is too much and I've just gone onto other things.

I am wondering if it is worthwhile to separate the output for each test into its own file. This would make it easier to find the interesting parts.

It would allow for targetting the specific file to cat should it fail or the config set success STDOUT to be shown. I like that idea.

FWIW from my experience with other CI, what I actually want is to see the debug info if the test run fails. E.g. with Travis CI with both configure and make check, I have on fail bits of the config that cat config.log test-suite.log respectively if the build fails, ideally I, or particularly a contributor, don't want to have to tweak the CI each time there's a failure, so some easy way to cat just the failing files would be great, either only writing them to disk if a test failed, or something built in which outputs all of a failed test just before BATS dies.

Thanks for this though, I'm really looking forward to it!

I can check again and make sure the level 2 output is included on failure, by default. Thanks for the feedback!

@NorseGaud
Copy link
Contributor Author

Hey @martin-schulze-vireso , I think I'm ready for a review. No tests yet, but again I'm going to wait until we're solid on the logic and how this should look before spending the time on that.

This is really cool so far 🥳

Copy link
Member

@martin-schulze-vireso martin-schulze-vireso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be intentional to only print the failing command but most people will understand --trace to mean: print everything. What is done here is more like: print on failure with two modes command (arguably no big improvement over the status quo) and print output (this seems to be what you want to get at.)

What I envisioned was to switch inside run based on the TRACE_LEVEL, whether to print the executed command and output unconditionally. I think your current implementation has another usecase and both might be needed.

I think everything should become much clearer if we start forming an acceptance test file for this feature.

@NorseGaud NorseGaud changed the title --trace <level> : show command and STDOUT/ERR in terminal --trace <level> : show command and STDOUT/ERR in terminal + failures show both Jul 25, 2021
@NorseGaud
Copy link
Contributor Author

Wanted to update here that I've been using this code in my day-to-day adding new tests or troubleshooting failures and it's awesome! The speed at which I can write bats tests now is really pleasant.

@NorseGaud NorseGaud changed the title --verbose & --trace <level> run: --verbose & --trace <level> Aug 17, 2021
@martin-schulze-vireso
Copy link
Member

I am working on getting a rebased version pushed with additional flags. There is more to come...

@martin-schulze-vireso
Copy link
Member

@NorseGaud I see that this was the master branch on your repository. I hope I did not break your existing scripts with force pusing over that. I also hope that I resolved all merge conflicts successfully without breaking either side.

@NorseGaud
Copy link
Contributor Author

@NorseGaud I see that this was the master branch on your repository. I hope I did not break your existing scripts with force pusing over that. I also hope that I resolved all merge conflicts successfully without breaking either side.

Nah, it's all good. I mistakenly did that and just was too lazy to fix it 😅

@NorseGaud
Copy link
Contributor Author

How do we want to handle shellcheck stuff?

@martin-schulze-vireso
Copy link
Member

@NorseGaud maybe we should hop over to gitter to resolve this more quickly.

@martin-schulze-vireso
Copy link
Member

Just to give a short summary of what is in this right now:

  • bats --trace (or via $BATS_TRACE_LEVEL=1 env var, this name might be subject to change): print executed commands
  • bats --print-output-on-failure (or via $BATS_PRINT_OUTPUT_ON_FAILURE env var): print the value of "$output" when a test fails
  • bats --show-output-of-succeeding-tests (or via $BATS_SHOW_OUTPUT_OF_SUCCEEDING_TESTS env var)
  • bats --verbose-run (or via $BATS_VERBOSE_RUN env var): make run print $output by default
  • bats --gather-test-outputs-in <dir> (or via $BATS_GATHER_TEST_OUTPUTS_IN=D<dir>, but then you have to ensure the directory exists): put output of each test (even succeeding!) into the given folder as files of the format <test number in suite>-<test description>.log

@NorseGaud
Copy link
Contributor Author

NorseGaud commented Aug 18, 2021

@martin-schulze-vireso , is there --trace but without all of the extra stuff? It's painful to use and scroll through to see what's running and output. Here is the output from my usage:

 ✗ testtest checking setup.sh: setup.sh relay add-domain
   (from function `assert_success' in file test/test_helper/bats-assert/src/assert.bash, line 114,
    in test file test/tests.bats, line 1152)
     `assert_success' failed
   $$$ [tests.bats:8]
   $$$ setup
   $$$ [tests.bats:9]
   $$$ run_setup_file_if_necessary
   $$$$ [common.bash:123]
   $$$$ native_setup_teardown_file_support
   $$$$$ [common.bash:107]
   $$$$$ local VERSION_REGEX='([0-9]+)\.([0-9]+)\.([0-9]+)'
   $$$$$ [common.bash:109]
   $$$$$ [[ "${BATS_VERSION}" =~ ${VERSION_REGEX} ]]
   $$$$$ [common.bash:110]
   $$$$$ numeric_version=$(( (BASH_REMATCH[1] * 100 + BASH_REMATCH[2]) * 100 + BASH_REMATCH[3] ))
   $$$$$ [common.bash:111]
   $$$$$ [[ ${numeric_version} -ge 10201 ]]
   $$$$$ [common.bash:112]
   $$$$$ [ "${BATS_TEST_NAME}" == 'test_first' ]
   $$$$$ [common.bash:115]
   $$$$$ return 0
   $$$$ [common.bash:123]
   $$$$ return 0
   $ [tests.bats:1145]
   $ ./setup.sh relay add-domain example1.org smtp.relay1.com 2525
   $ [tests.bats:1146]
   $ ./setup.sh relay add-domain example2.org smtp.relay2.com
   $ [tests.bats:1147]
   $ ./setup.sh relay add-domain example3.org smtp.relay3.com 2525
   $ [tests.bats:1148]
   $ ./setup.sh relay add-domain example3.org smtp.relay.com 587
   $ [tests.bats:1151]
   $ run /bin/sh -c "cat $(private_config_path mail)/postfix-relaymap.cf | grep -e \"^@example1.org\s\+\[smtp.relay1.com\]:2525\" | wc -l | grep 1"
   $ [tests.bats:1152]
   $ assert_success
   $$ [assert.bash:109]
   $$ (( status != 0 ))
   $$ [assert.bash:113]
   $$ batslib_decorate 'command failed'
   $$ [assert.bash:114]
   $$ fail
   $$$ [error.bash:39]
   $$$ (( $# == 0 ))
   $$$ [error.bash:39]
   $$$ batslib_err
   $$$$ [output.bash:38]
   $$$$ (( $# > 0 ))
   $$$$ [output.bash:41]
   $$$$ cat -
   $$$ [output.bash:274]
   $$$ echo
   
   $$$ [output.bash:275]
   $$$ echo "-- $1 --"
   -- command failed --
   $$$ [output.bash:276]
   $$$ cat -
   $$ [assert.bash:110]
   $$ local -ir width=6
   $$ [assert.bash:111]
   $$ batslib_print_kv_single "$width" 'status' "$status"
   $$$ [output.bash:130]
   $$$ local -ir col_width="$1"
   $$$ [output.bash:130]
   $$$ shift
   $$$ [output.bash:131]
   $$$ (( $# != 0 ))
   $$$ [output.bash:132]
   $$$ printf '%-*s : %s\n' "$col_width" "$1" "$2"
   status : 1
   $$$ [output.bash:133]
   $$$ shift 2
   $$$ [output.bash:131]
   $$$ (( $# != 0 ))
   $$ [assert.bash:112]
   $$ batslib_print_kv_single_or_multi "$width" 'output' "$output"
   $$$ [output.bash:183]
   $$$ local -ir width="$1"
   $$$ [output.bash:183]
   $$$ shift
   $$$ [output.bash:184]
   $$$ local -a pairs=("$@")
   $$$ [output.bash:186]
   $$$ local -a values=()
   $$$ [output.bash:187]
   $$$ local -i i
   $$$ [output.bash:188]
   $$$ ((i=1))
   $$$ [output.bash:188]
   $$$ ((i < 2))
   $$$ [output.bash:189]
   $$$ values+=("${pairs[$i]}")
   $$$ [output.bash:188]
   $$$ ((i+=2 ))
   $$$ [output.bash:188]
   $$$ ((i < 2))
   $$$ [output.bash:192]
   $$$ batslib_is_single_line "${values[@]}"
   $$$$ [output.bash:81]
   $$$$ for string in "$@"
   $$$$ [output.bash:82]
   $$$$ (( $(batslib_count_lines "$string") > 1 ))
   /Users/norsegaud/docker-mailserver/test/test_helper/bats-support/src/output.bash: line 82: $$$$ [output.bash:82]
   $$$$ batslib_count_lines "$string"
   $$$$$ [output.bash:63]
   $$$$$ local -i n_lines=0
   $$$$$ [output.bash:64]
   $$$$$ local line
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:65]
   $$$$$ [[ -n $line ]]
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:65]
   $$$$$ [[ -n $line ]]
   $$$$$ [output.bash:68]
   $$$$$ echo "$n_lines"
   8 > 1 : syntax error: operand expected (error token is "$$$$ [output.bash:82]
   $$$$ batslib_count_lines "$string"
   $$$$$ [output.bash:63]
   $$$$$ local -i n_lines=0
   $$$$$ [output.bash:64]
   $$$$$ local line
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:65]
   $$$$$ [[ -n $line ]]
   $$$$$ [output.bash:66]
   $$$$$ (( ++n_lines ))
   $$$$$ [output.bash:65]
   $$$$$ IFS='' read -r line
   $$$$$ [output.bash:65]
   $$$$$ [[ -n $line ]]
   $$$$$ [output.bash:68]
   $$$$$ echo "$n_lines"
   8 > 1 ")
   $$$$ [output.bash:84]
   $$$$ return 0
   $$$ [output.bash:193]
   $$$ batslib_print_kv_single "$width" "${pairs[@]}"
   $$$$ [output.bash:130]
   $$$$ local -ir col_width="$1"
   $$$$ [output.bash:130]
   $$$$ shift
   $$$$ [output.bash:131]
   $$$$ (( $# != 0 ))
   $$$$ [output.bash:132]
   $$$$ printf '%-*s : %s\n' "$col_width" "$1" "$2"
   output : cat: $: No such file or directory
   cat: [tests.bats:1151]: No such file or directory
   /bin/sh: line 1: $: command not found
   /bin/sh: line 2: 29678: command not found
   /bin/sh: line 3: 29678: command not found
   /bin/sh: line 4: /Users/norsegaud/docker-mailserver/test/duplicate_configs/mail/postfix-relaymap.cf: Permission denied
   $$$$ [output.bash:133]
   $$$$ shift 2
   $$$$ [output.bash:131]
   $$$$ (( $# != 0 ))
   $$$ [output.bash:277]
   $$$ echo '--'
   --
   $$$ [output.bash:278]
   $$$ echo
   
   $$$ [error.bash:40]
   $$$ return 1

Definitely way too much output

Side note: --trace actually fails the tests. Without it, it passes. Here is the test:

@test "checking setup.sh: setup.sh relay add-domain" {
  ./setup.sh relay add-domain example1.org smtp.relay1.com 2525
  ./setup.sh relay add-domain example2.org smtp.relay2.com
  ./setup.sh relay add-domain example3.org smtp.relay3.com 2525
  ./setup.sh relay add-domain example3.org smtp.relay.com 587

  # check adding
  run /bin/sh -c "cat $(private_config_path mail)/postfix-relaymap.cf | grep -e \"^@example1.org\s\+\[smtp.relay1.com\]:2525\" | wc -l | grep 1"
  assert_success
  # test default port
  run /bin/sh -c "cat $(private_config_path mail)/postfix-relaymap.cf | grep -e \"^@example2.org\s\+\[smtp.relay2.com\]:25\" | wc -l | grep 1"
  assert_success
  # test modifying
  run /bin/sh -c "cat $(private_config_path mail)/postfix-relaymap.cf | grep -e \"^@example3.org\s\+\[smtp.relay.com\]:587\" | wc -l | grep 1"
  assert_success
}

@martin-schulze-vireso
Copy link
Member

martin-schulze-vireso commented Aug 19, 2021

Obviously there is a lot going on. The problems that I can identify:

  1. the trace also contains internals of the bats-assert library. This is definitely not what we want. However, from core is hard to anticipate where it is installed. I have to think about a general solution how to disable traces in specific areas.
  2. The file labels are too much on many locations. I think they would suffice at each stack push/pop event.
  3. the trace output is not printed into its own FD, this likely breaks some internals.

I'll see to it ASAP.

By the way: That setup_file_if_necessary switch is not working as intended, as the major version multiplier is too small. You can probably do away with it if there are no people who are using bats pre 1.2.1 in your team anymore.

@martin-schulze-vireso
Copy link
Member

Okay, I pushed the changes discussed above apart from the FD change. I am not sure if it is necessary and I'd really like the interleaving of the output, which will be broken when using another FD that is not buffered by bats.

@martin-schulze-vireso
Copy link
Member

Okay, the separate FD is necessary but I still got the interleaving. I opted for using static FD4. Hopefully that is enough for most cases.

@NorseGaud
Copy link
Contributor Author

Way more managable now and doesn't fail the tests anymore! Nice!

Some examples after a changed some tests to fail:

❯ test/bats/bin/bats --trace --filter "checking setup.sh: setup.sh delquota" test/tests.bats 
 ✗ checking setup.sh: setup.sh delquota
   (in test file test/tests.bats, line 1103)
     `assert_failure' failed
   $ [tests.bats:1094]
   $ run ./setup.sh email add quota_user@example.com test_password
   $ run ./setup.sh email add quota_user2@example.com test_password
   $ run ./setup.sh quota set quota_user@example.com 12M
   $ assert_success
   $ run /bin/sh -c 'cat ./test/duplicate_configs/mail/dovecot-quotas.cf | grep -E "^quota_user@example.com\:12M\$" | wc -l | grep 1'
   $ assert_success
   $ run ./setup.sh quota del unknown@domain.com
   $ assert_failure
   $ run /bin/sh -c 'cat ./test/duplicate_configs/mail/dovecot-quotas.cf | grep -E "^quota_user@example.com\:12M\$" | wc -l | grep 1'
   $ assert_failure
   
   -- command succeeded, but it was expected to fail --
   output :        1
   --
   

1 test, 1 failure
❯ test/bats/bin/bats --trace --verbose-run --filter "checking setup.sh: setup.sh delquota" test/tests.bats
 ✗ checking setup.sh: setup.sh delquota
   (in test file test/tests.bats, line 1103)
     `assert_failure' failed
   $ [tests.bats:1094]
   $ run ./setup.sh email add quota_user@example.com test_password
   
   $ run ./setup.sh email add quota_user2@example.com test_password
   
   $ run ./setup.sh quota set quota_user@example.com 12M
   
   $ assert_success
   $ run /bin/sh -c 'cat ./test/duplicate_configs/mail/dovecot-quotas.cf | grep -E "^quota_user@example.com\:12M\$" | wc -l | grep 1'
          1
   $ assert_success
   $ run ./setup.sh quota del unknown@domain.com
   Usage: delquota <username@domain>
   Error :: user unknown@domain.com does not exist
   Aborting.
   
   --- UNCHECKED ERROR
     - script    = setup.sh
     - function  = _docker_container / ${CRI} exec "${USE_TTY}" "${CONTAINER_NAME}" "${@:+$@}"
     - line      = 245
     - exit code = 1
   
   Make sure you use a version of this script that matches
   the version / tag of docker-mailserver. Please read the
   'Get the tools' section in the README on GitHub careful-
   ly and use ./setup.sh help and read the VERSION section.
   $ assert_failure
   $ run /bin/sh -c 'cat ./test/duplicate_configs/mail/dovecot-quotas.cf | grep -E "^quota_user@example.com\:12M\$" | wc -l | grep 1'
          1
   $ assert_failure
   
   -- command succeeded, but it was expected to fail --
   output :        1
   --
   

1 test, 1 failure

@NorseGaud
Copy link
Contributor Author

I have what I need with the following:

--trace --verbose-run seems to work great for failures.
--trace --verbose-run --show-output-of-succeeding-tests works great for success (though output is in red).

@NorseGaud NorseGaud changed the title run: --verbose & --trace <level> Verbose output for faster troubleshooting of test problems Aug 20, 2021
@martin-schulze-vireso
Copy link
Member

martin-schulze-vireso commented Aug 20, 2021

@NorseGaud I am sorry, I had a typo in the (force) push command and probably erased the master branch on your remote. It looks like I can't reinstate it from my end and can't even reopen this PR. IF you can get this reopened, please use the code from https://github.com/bats-core/bats-core/tree/trace_and_more

@NorseGaud
Copy link
Contributor Author

All good @martin-schulze-vireso , I can restore the branch

@NorseGaud NorseGaud changed the title Verbose output for faster troubleshooting of test problems [ignore] Verbose output for faster troubleshooting of test problems Aug 20, 2021
debarshiray added a commit to allisonkarlitskaya/toolbox that referenced this pull request Nov 14, 2022
Note that file descriptors 3 and 4 are reserved by Bats.  The former is
used for adding custom text to the Test Anything Protocol (or TAP)
stream [1] and the latter for tracing.

[1] https://bats-core.readthedocs.io/en/stable/writing-tests.html#file-descriptor-3-read-this-if-bats-hangs
    https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal

[2] Bats commit 635700cd2282b754
    bats-core/bats-core#467
    bats-core/bats-core#488

containers#1066
debarshiray added a commit to allisonkarlitskaya/toolbox that referenced this pull request Nov 14, 2022
Note that file descriptors 3 and 4 are reserved by Bats.  The former is
used for adding custom text to the Test Anything Protocol (or TAP)
stream [1] and the latter for tracing [2].

[1] https://bats-core.readthedocs.io/en/stable/writing-tests.html#file-descriptor-3-read-this-if-bats-hangs
    https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal

[2] Bats commit 635700cd2282b754
    bats-core/bats-core#467
    bats-core/bats-core#488

containers#1066
debarshiray added a commit to allisonkarlitskaya/toolbox that referenced this pull request Nov 14, 2022
Note that file descriptors 3 and 4 are reserved by Bats.  The former is
used for adding custom text to the Test Anything Protocol (or TAP)
stream [1] and the latter for tracing [2].

[1] https://bats-core.readthedocs.io/en/stable/writing-tests.html#file-descriptor-3-read-this-if-bats-hangs
    https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal

[2] Bats commit 635700cd2282b754
    bats-core/bats-core#467
    bats-core/bats-core#488

containers#1066
debarshiray added a commit to allisonkarlitskaya/toolbox that referenced this pull request Nov 14, 2022
Note that file descriptors 3 and 4 are reserved by Bats.  The former is
used for adding custom text to the Test Anything Protocol (or TAP)
stream [1] and the latter for tracing [2].

[1] https://bats-core.readthedocs.io/en/stable/writing-tests.html#file-descriptor-3-read-this-if-bats-hangs
    https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal

[2] Bats commit 635700cd2282b754
    bats-core/bats-core#467
    bats-core/bats-core#488

containers#1066
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Bash Code Everything regarding the bash code Priority: High Broken behavior in specific environments like in parallel mode or only on some operating systems Status: Duplicate Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants