Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit 194574c

Browse files
author
David Chung
authored
add better logging and delays to avoid race in e2e-test (#738)
Signed-off-by: David Chung <[email protected]>
1 parent 1e53577 commit 194574c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

scripts/e2e-test.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ expect_exact_output() {
100100
echo 'FAIL'
101101
echo "Expected output: $expected_output"
102102
echo "Actual output: $actual_output"
103+
echo "infrakit -h"
104+
infrakit -h
103105
exit 1
104106
fi
105107
}
@@ -118,6 +120,8 @@ expect_output_lines() {
118120
echo 'FAIL'
119121
echo "Expected line count: $expected_lines"
120122
echo "Actual line count: $actual_line_count"
123+
echo "infrakit -h"
124+
infrakit -h
121125
exit 1
122126
fi
123127
}
@@ -141,8 +145,18 @@ infrakit group/cattle free
141145
echo "Freed cattles; committing again"
142146

143147
infrakit group commit scripts/cattle.json
148+
149+
sleep 10
150+
151+
if [[ $(infrakit -h | grep group/cattle) == "" ]]; then
152+
echo "checking the CLI"
153+
infrakit -h
154+
fi
155+
144156
expect_exact_output "Should be watching one group" "infrakit group ls -q" "cattle"
145157

158+
echo "Updating specs to scale group to 10"
159+
146160
expect_exact_output \
147161
"Update should roll 5 and scale group to 10" \
148162
"infrakit group/cattle commit scripts/cattle2.json --pretend" \
@@ -154,16 +168,19 @@ sleep 10
154168

155169
expect_output_lines "10 instances should exist in group" "infrakit group/cattle describe -q" "10"
156170

157-
# Terminate 3 instances.
171+
echo "Terminate 3 instances."
172+
158173
pushd $INSTANCE_FILE_DIR
159174
rm $(ls | head -3)
160175
popd
161176

162177
sleep 10
163178

164-
expect_output_lines "10 instances should exist in group" "infrakit group describe cattle -q" "10"
179+
expect_output_lines "10 instances should exist in group" "infrakit group/cattle describe -q" "10"
165180

166181
infrakit group/cattle destroy
182+
183+
sleep 10
167184
expect_output_lines "0 instances should exist" "infrakit instance-file describe -q " "0"
168185

169186
echo 'ALL TESTS PASSED'

0 commit comments

Comments
 (0)