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

stabilize e2e test case sandbox-basic #962

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kuttl-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

apiVersion: kuttl.dev/v1beta1
kind: TestSuite
kindNodeCache: true
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This allows the downloaded images to be cached on the node. This will speed up test case execution.

# Each testcase will delete its own namespace if it is successful. This
# allows us to collect scrutinize for all of the failed tests.
skipDelete: true
Expand Down
5 changes: 4 additions & 1 deletion tests/e2e-leg-10/sandbox-basic/20-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 1200
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: bash -c "../../../scripts/wait-for-verticadb-steady-state.sh -n verticadb-operator -t 360 $NAMESPACE"
- command: sleep 120
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add this latency to stabilize the cluster before step 60 starts.

Copy link
Collaborator

@roypaulin roypaulin Oct 17, 2024

Choose a reason for hiding this comment

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

You don't need to add this sleep. It will take the test longer to complete. If this frequently fails due to insufficient timeout, then just increase the timeout in the script call above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is different from timeout. The timeout is the maximum wait time for the whole test step to finish. This sleep call gives the cluster some time to stabilize its state before the next step starts. It makes the test run longer but it makes the test pass.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The script on line 17 waits for the operator to be steady(gives the cluster some time to stabilize its state before the next step) meaning there is no error and nothing going on. There is no benefit in adding another wait after. If this step fails and more time is needed, you should increase the time passed as argument to the script.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is from that wait-for-verticadb-steady-state.sh

timeout $TIMEOUT bash -c -- "while ! $LOG_CMD | \ grep $WEBHOOK_FILTER | \ grep $DEPRECATION_FILTER | \ grep $VDB_FILTER | \ tail -1 | grep --quiet '\"result\": {\"Requeue\":false,\"RequeueAfter\":0}, \"err\": null'; do sleep 1; done" & pid=$! wait $pid

This is from "man timeout":
timeout - run a command with a time limit

If the script runs longer than the $TIMEOUT, an error will be reported.
If the script finishes within the $TIMEOUT, the next step starts right away.
What I want to achieve is to add a latency between the two steps to make sure the latter
step is not impacted by the previous step. Increasing the timeout will not achieve that.

6 changes: 5 additions & 1 deletion tests/e2e-leg-10/sandbox-basic/60-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 900
---
apiVersion: v1
kind: Event
reason: UnsandboxSubclusterSucceeded
Expand Down Expand Up @@ -65,4 +69,4 @@ status:
name: sec2
- addedToDBCount: 1
upNodeCount: 1
name: sec3
name: sec3
5 changes: 4 additions & 1 deletion tests/e2e-leg-10/sandbox-basic/60-unsandbox-sec3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: kuttl.dev/v1beta1
kind: TestStep
timeout: 900
---
apiVersion: vertica.com/v1
kind: VerticaDB
metadata:
Expand Down
Loading