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

Test background stop timeout #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dagguh
Copy link
Member

@dagguh dagguh commented May 14, 2021

No description provided.

@dagguh dagguh requested a review from a team as a code owner May 14, 2021 13:53
trap 'echo "got interrupted"' INT
for i in {1..10}
do
echo "sleeping ${'$'}i..."
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this substitution, what is it supposed to do?

Copy link
Member Author

@dagguh dagguh May 14, 2021

Choose a reason for hiding this comment

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

${'$'} is a way to print a literal $ within a multiline string literal """.
Otherwise it'd be $i and there's no Kotlin i here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I tested it on Bash and ZSH and in both cases I got "bad substitution" error.

Copy link
Member Author

@dagguh dagguh May 14, 2021

Choose a reason for hiding this comment

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

Try $i in Bash/ZSH. Or run/debug the JUnit test
Here's the Bash version:

trap 'echo "got interrupted"' INT
for i in {1..10}
do
    echo "sleeping $i..."
    sleep 1
done  

You can try ctrl-C while it loops

Copy link
Contributor

Choose a reason for hiding this comment

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

OMG, brain fog. It' a Kotlin substitution 🤦 . Ignore me :)

Copy link
Member Author

Choose a reason for hiding this comment

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

If you want to restore your bash session to normal, you can clear the trap via trap - INT

@dagguh dagguh enabled auto-merge (rebase) May 14, 2021 14:36
@dagguh
Copy link
Member Author

dagguh commented May 14, 2021

CI is green on my fork.
The PR CI times out (ironic) even after reruns. I'll force-push it to generate a new commit hash.

@dagguh
Copy link
Member Author

dagguh commented May 14, 2021

It got cancelled again. I guess I'll retry later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants