Skip to content

Test background stop timeout - #16

Open
dagguh wants to merge 1 commit into
atlassian:masterfrom
dagguh:test-background-stop-timeout
Open

Test background stop timeout#16
dagguh wants to merge 1 commit into
atlassian:masterfrom
dagguh:test-background-stop-timeout

Conversation

@dagguh

Copy link
Copy Markdown
Contributor

No description provided.

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

Copy link
Copy Markdown
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?

@dagguhdagguhMay 14, 2021

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
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.

@dagguhdagguhMay 14, 2021

Copy link
Copy Markdown
ContributorAuthor

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
foriin {1..10}
doecho"sleeping $i..."
sleep 1
done

You can try ctrl-C while it loops

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

mzyromski-atlassian
mzyromski-atlassian previously approved these changes May 14, 2021
@dagguh
dagguh enabled auto-merge (rebase) May 14, 2021 14:36
@dagguh

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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

Sign up for freeto 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

@dagguh@mzyromski-atlassian