Skip to content

chore: remove inactive browserstack wrapper package #1991

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

Merged
merged 5 commits into from
Dec 1, 2016

Conversation

devversion
Copy link
Member

@devversion devversion commented Nov 26, 2016

  • No longer uses the "inactive" browserstack wrapper package from npm, which was just responsible for creating the readyfile.

  • We can create the readyfile ourself and get rid of the npm package.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 26, 2016
@devversion devversion changed the title chore: remove incactive browserstack wrapper package chore: remove inactive browserstack wrapper package Nov 26, 2016
@devversion devversion force-pushed the chore/use-own-wrapper branch from e17b70c to d44c4ae Compare November 26, 2016 15:11
No longer uses the "inactive" browserstack wrapper package from npm,
which was just responsible for creating the readyfile.

We can create the readyfile ourself and get rid of the npm package.
@devversion devversion force-pushed the chore/use-own-wrapper branch from d44c4ae to 6b5662b Compare November 26, 2016 15:27

cd $TUNNEL_DIR

# Download the saucelabs connect binaries.
Copy link
Member

Choose a reason for hiding this comment

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

"saucelabs" (here and other places in this file)

Copy link
Member Author

@devversion devversion Nov 29, 2016

Choose a reason for hiding this comment

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

Good catch. I made the two files in the material.angular.io CI setup as similar as possible (so we can share a lot)

@jelbourn
Copy link
Member

@hansl can you take a look at this?

hansl
hansl previously requested changes Nov 29, 2016

echo "BrowserStack Tunnel ready"

touch $BROWSER_PROVIDER_READY_FILE
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use killall instead of output the PID of browserstack in the ready file?

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it to killall because we are doing the same with sauce-connect and it would be consistent with the readyfile API from sauce-connect

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not 100% convinced yet that this is right; what if you run these scripts locally on your computer?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can see what you mean, but I think you won't be able to fix this for saucelabs, because the integrated --readyfile option can't write any PID to the file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay that's fair.


# Disown the background process, because we don't want to show any messages when killing
# the timer.
disown
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 think you need to disown here, since you're &> /dev/null below. Right?

Copy link
Member Author

Choose a reason for hiding this comment

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

The &> /dev/null won't have an effect on that, because when using the kill command the process always prints a message that the child-process terminated.


# When the tail recognizes the `Ctrl-C` log message the BrowserStack Tunnel is up.
{
tail -n0 -f $TUNNEL_LOG --pid $TIMER_PID | { sed '/Ctrl/q' && kill -9 $TIMER_PID; };
Copy link
Contributor

Choose a reason for hiding this comment

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

If it takes more than 2 minutes the tail will exit. We should treat that case since it's an error and it would try to connect later on to browser stack but would fail (since the tunnel isn't connected but this script succeeded).

The way to do that would be (my BASH is rusty) to, instead of just sleep 120 & do something like

  (sleep 120; echo ERROR TIMEOUT > $BROWSER_STACK_ERROR_FILE) &

then on the wait tunnel script, if ERROR_FILE exists just exit with a special code that fails the test.

What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

The tail should only run 2 minutes at maximum. If the specific string was found then the $TIMER_PID will be killed and the tail exits.

Did you mean something else?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, if the tail runs for longer than 2 minutes because the connection to the tunnel takes longer. The timer will terminate but the process will succeed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it. Yeah I like that idea with the error file. Will change that

@hansl
Copy link
Contributor

hansl commented Nov 29, 2016

Just fix the timeout issue and you'll get my LGTM. Good work!

@devversion
Copy link
Member Author

@hansl Done :)

@@ -12,6 +13,11 @@ while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do
echo
echo "Timed out after 2 minutes waiting for tunnel ready file"
exit 5
elif [ -f $BROWSER_PROVIDER_ERROR_FILE ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a race condition here, since READY_FILE will still be created when ERROR_FILE exists. Moving this IF outside the while will ensure we always take care of this case.

@hansl
Copy link
Contributor

hansl commented Nov 30, 2016

1 small nit and LGTM! Thanks

@devversion
Copy link
Member Author

@hansl Good point -Fixed. Thanks again for your great comments!

@jelbourn jelbourn dismissed hansl’s stale review December 1, 2016 18:43

Changes made

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Dec 1, 2016
@tinayuangao tinayuangao merged commit 6534eb0 into angular:master Dec 1, 2016
@devversion devversion deleted the chore/use-own-wrapper branch November 11, 2017 10:18
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants