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

End to end tests: hab-svc-load and hup-does-not-abandon-services #6849

Merged
merged 7 commits into from
Aug 16, 2019

Conversation

baumanj
Copy link
Contributor

@baumanj baumanj commented Aug 14, 2019

Add/fix these two tests for our end-to-end CI. This will merge back into #6780.

See also #6816

@chef-expeditor
Copy link
Contributor

Hello baumanj! Thanks for the pull request!

Here is what will happen next:

  1. Your PR will be reviewed by the maintainers.
  2. If everything looks good, one of them will approve it, and your PR will be merged.

Thank you for contributing!

@baumanj baumanj force-pushed the end-to-end/hup-does-not-abandon-services branch 2 times, most recently from 99229bf to 1911efa Compare August 14, 2019 22:54
@baumanj baumanj changed the base branch from master to cm/end-to-end August 14, 2019 23:25
@baumanj baumanj force-pushed the end-to-end/hup-does-not-abandon-services branch from 9b38e38 to eab5307 Compare August 14, 2019 23:35
@baumanj baumanj self-assigned this Aug 14, 2019
@baumanj baumanj changed the title End to end/hup does not abandon services End to end tests: hab-svc-load and hup-does-not-abandon-services Aug 14, 2019
@baumanj baumanj marked this pull request as ready for review August 14, 2019 23:39
Copy link
Contributor

@christophermaier christophermaier left a comment

Choose a reason for hiding this comment

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

Looks good, but it would be good to address the race condition.

- label: "[:linux: hup-does-not-abandon-services]"
command:
- .expeditor/scripts/setup_environment.sh DEV
- hab pkg install --binlink core/expect/5.45.4/20190115014137
Copy link
Contributor

Choose a reason for hiding this comment

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

The reason the fully-qualified ident is needed here is because the environment contains HAB_BLDR_CHANNEL=DEV (see line 13 above), and there isn't a core/expect in that channel.

Since the exact release of expect isn't really important here, we could simplify this to

hab pkg install --binlink --channel=stable core/expect/5.45.4

or, simpler still, to

hab pkg install --binlink --channel=stable core/expect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's the advantage? I don't think expect is likely to change in a way that's relevant to this test. Pinning it has the advantage to eliminating a potential difference when running this in different environments.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's just that when I see a pin, I immediately wonder what the significance of that specific release is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough. I'll try changing it.

@@ -99,7 +99,7 @@ expect {
error "Redis not ready to accept connections!"
}
}
set redis_pid [exec pgrep redis-server]
set redis_pid [exec cat /hab/svc/redis/PID]
Copy link
Contributor

Choose a reason for hiding this comment

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

When I run this test locally, it will sometimes fail at this part; it looks like there might be a race between when the Supervisor writes this PID file and when the test tries to read it.

If I add a sleep 1 immediately before this check, for instance, I see no failures.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

0d5487c should address this

Copy link
Contributor

Choose a reason for hiding this comment

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

That works.

Out of curiosity, what prompted you to move away from the pgrep approach to the PID file? Not having to worry about whether pgrep would be there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I mentioned in c53bfa1:

there may be other redis-servers running locally.

To wit:

jbauman@ubuntu:~/habitat$ pgrep -afl redis-server
77398 /opt/opscode/embedded/bin/redis-server 127.0.0.1:16379                         

sleep 1

# Load up Redis on that Supervisor
spawn hab svc load core/redis
Copy link
Contributor

Choose a reason for hiding this comment

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

Initially, I was surprised to see that this package installation was coming from stable and not DEV, but then I discovered that the HAB_BLDR_CHANNEL environment variable is ignored in hab svc load.

@christophermaier
Copy link
Contributor

Incidentally, I think you can rebase your work directly on master and merge from there. I don't think any of your changes are dependent on the ones from my PR.

@baumanj baumanj force-pushed the end-to-end/hup-does-not-abandon-services branch from eab5307 to 0d5487c Compare August 15, 2019 18:27
@baumanj
Copy link
Contributor Author

baumanj commented Aug 15, 2019

Incidentally, I think you can rebase your work directly on master and merge from there. I don't think any of your changes are dependent on the ones from my PR.

Any reason not to merge back into your PR? All the e2e work is captured in the same issue, and there are some things in my changes that may be useful to the other e2e tests. Also, it'll just be less work for me to merge it as is since my branch was based on yours from the beginning.

@christophermaier
Copy link
Contributor

Incidentally, I think you can rebase your work directly on master and merge from there. I don't think any of your changes are dependent on the ones from my PR.

Any reason not to merge back into your PR? All the e2e work is captured in the same issue, and there are some things in my changes that may be useful to the other e2e tests. Also, it'll just be less work for me to merge it as is since my branch was based on yours from the beginning.

If I were to rework and force-push my branch then that could mess yours up. They're not inherently coupled. If your PR has something I (or anyone else) can use, then I'll rebase mine when yours merges.

@baumanj baumanj force-pushed the end-to-end/hup-does-not-abandon-services branch from 0d5487c to 91bc0d2 Compare August 15, 2019 22:56
@baumanj baumanj changed the base branch from cm/end-to-end to master August 15, 2019 22:56
Some minor tweaks were necessary to the expect file. Notably, replace
`pgrep redis-server` with accessing /hab/svc/redis/PID, since there may
be other `redis-server`s running locally.

Signed-off-by: Jon Bauman <5906042+baumanj@users.noreply.github.com>
Signed-off-by: Jon Bauman <5906042+baumanj@users.noreply.github.com>
We discovered #6852 as part
of hup-does-not-abandon-services.exp, but that test is more complex.
It's preferable to have a simpler, more targeted test as well which
makes the nature of the failure (and potential regression) clearer.

Signed-off-by: Jon Bauman <5906042+baumanj@users.noreply.github.com>
Signed-off-by: Jon Bauman <5906042+baumanj@users.noreply.github.com>
@baumanj baumanj force-pushed the end-to-end/hup-does-not-abandon-services branch from 91bc0d2 to aaac068 Compare August 15, 2019 23:15
Signed-off-by: Christopher Maier <cmaier@chef.io>
Signed-off-by: Jon Bauman <5906042+baumanj@users.noreply.github.com>
Signed-off-by: Jon Bauman <5906042+baumanj@users.noreply.github.com>
@baumanj baumanj force-pushed the end-to-end/hup-does-not-abandon-services branch from 51919f1 to b399808 Compare August 16, 2019 00:08
@baumanj
Copy link
Contributor Author

baumanj commented Aug 16, 2019

I think I've addressed all the feedback now.

@baumanj baumanj merged commit 003b835 into master Aug 16, 2019
@baumanj baumanj deleted the end-to-end/hup-does-not-abandon-services branch August 16, 2019 19:31
@scotthain
Copy link
Contributor

This is drive-by post-merge commentary that may have been resolved somewhere else, but it looks like ACCEPTANCE_HAB_BLDR_URL was changed to HAB_BLDR_URL and not all instances were change later in the pipeline.

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.

3 participants