-
Notifications
You must be signed in to change notification settings - Fork 314
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
Conversation
Hello baumanj! Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
99229bf
to
1911efa
Compare
9b38e38
to
eab5307
Compare
There was a problem hiding this 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.
.expeditor/end_to_end.pipeline.yml
Outdated
- label: "[:linux: hup-does-not-abandon-services]" | ||
command: | ||
- .expeditor/scripts/setup_environment.sh DEV | ||
- hab pkg install --binlink core/expect/5.45.4/20190115014137 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0d5487c should address this
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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-server
s 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 |
There was a problem hiding this comment.
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
.
Incidentally, I think you can rebase your work directly on |
eab5307
to
0d5487c
Compare
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. |
0d5487c
to
91bc0d2
Compare
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>
91bc0d2
to
aaac068
Compare
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>
51919f1
to
b399808
Compare
I think I've addressed all the feedback now. |
This is drive-by post-merge commentary that may have been resolved somewhere else, but it looks like |
Add/fix these two tests for our end-to-end CI. This will merge back into #6780.
See also #6816