Skip to content

Commit

Permalink
ROX-19494: Increase timeout and improve debugability of e2e test. (#1244
Browse files Browse the repository at this point in the history
)

* Bump ready timeout, log more, add timestamps.
  • Loading branch information
porridge authored Sep 11, 2023
1 parent f35e8b2 commit f4133e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dev/env/scripts/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if [[ "$SPAWN_LOGGER" == "true" && -n "${LOG_DIR:-}" ]]; then
fi

# Sanity check.
wait_for_container_to_become_ready "$ACSMS_NAMESPACE" "application=fleetshard-sync" "fleetshard-sync"
wait_for_container_to_become_ready "$ACSMS_NAMESPACE" "application=fleetshard-sync" "fleetshard-sync" 500
# Prerequisite for port-forwarding are pods in ready state.
wait_for_container_to_become_ready "$ACSMS_NAMESPACE" "application=fleet-manager" "fleet-manager"

Expand Down
10 changes: 8 additions & 2 deletions fleetshard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ func main() {
glog.Infof("ManagedDB.SecurityGroup: %s", config.ManagedDB.SecurityGroup)
glog.Infof("ManagedDB.SubnetGroup: %s", config.ManagedDB.SubnetGroup)

runtime, err := runtime.NewRuntime(config, k8s.CreateClientOrDie())
glog.Info("Creating k8s client...")
k8sClient := k8s.CreateClientOrDie()
glog.Info("Creating runtime...")
runtime, err := runtime.NewRuntime(config, k8sClient)
if err != nil {
glog.Fatal(err)
}
Expand All @@ -52,6 +55,7 @@ func main() {
}
}()

glog.Info("Creating metrics server...")
metricServer := fleetshardmetrics.NewMetricsServer(config.MetricsAddress)
go func() {
if err := metricServer.ListenAndServe(); err != nil {
Expand All @@ -60,8 +64,10 @@ func main() {
}()

sigs := make(chan os.Signal, 1)
signal.Notify(sigs, os.Interrupt, unix.SIGTERM)
notifySignals := []os.Signal{os.Interrupt, unix.SIGTERM}
signal.Notify(sigs, notifySignals...)

glog.Infof("Application started. Will shut down gracefully on %s.", notifySignals)
sig := <-sigs
runtime.Stop()
if err := metricServer.Close(); err != nil {
Expand Down
8 changes: 2 additions & 6 deletions scripts/lib/log.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
#!/usr/bin/env bash

die() {
{
# shellcheck disable=SC2059
printf "$*"
echo
} >&2
log "$@" >&2
exit 1
}

log() {
# shellcheck disable=SC2059
printf "$*"
printf "$(date "+%Y-%m-%dT%H:%M:%S,%N%:z") $*"
echo
}

0 comments on commit f4133e0

Please sign in to comment.