source-controller/internal
Sunny 1a7adeb801 Fix helmrepo reconciler unfinished worker bug
Although all the APIs had interval as a required field, when tests
objects were created, they had the zero value of interval, which the API
server accepts. A zero interval value results in the test objects to
reconcile only once when they are created and never reconcile again
unless there's an update to the object. Most of the tests worked with
this behavior.

With HelmRepository removing the interval requirement and adding an
internal default, all the HelmRepository objects created in the tests
without any interval have a default interval value which results in
objects to reconcile automatically if they are not cleaned up after
running tests. TestHelmRepositoryReconciler_InMemoryCaching and
TestHelmChartReconciler_Reconcile create HelmRepository but doesn't
delete it at the end. This leads to a reconciliation of HelmRepository
outside of the test in the envtest environment. It just happened to be
that the reconciliation time matches with the end of test time. At the
end of the test run, the reconcilers receive shutdown signal and any
test server, like helmrepository server, are stopped. A HelmRepository
reconciliation triggered just before the shutdown signal gets stuck in
the reconciliation. HelmRepository can't download the index as the test
index server has stopped and hangs for some time. The HelmRepository
reconciler worker remains in active state, unlike other reconciler
workers that shut down, resulting in the test to timeout at the end.

The is fixed by deleting the HelmRepository object created in
TestHelmRepositoryReconciler_InMemoryCaching and
TestHelmChartReconciler_Reconcile at the end of the test similar to
other tests.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2023-11-22 21:05:57 +05:30
..
cache Delete stale metrics on object delete 2023-08-15 02:35:35 +05:30
controller Fix helmrepo reconciler unfinished worker bug 2023-11-22 21:05:57 +05:30
digest digest: register SHA1 digest algorithm 2023-02-14 12:48:36 +01:00
error Remove event error 2023-09-15 17:41:43 +05:30
features gitrepo: remove `OptimizedGitClones` as a feature gate 2023-06-21 16:48:18 +05:30
fs test: use `T.TempDir` to create temporary test directory 2022-04-29 23:01:39 +08:00
helm optional interval and default timeout for helmrepo 2023-11-22 21:05:57 +05:30
index controllers: use digest for Bucket revision 2023-02-14 12:48:36 +01:00
mock misc: use `Err` prefix for errors 2023-10-09 14:59:58 +02:00
object Promote GitRepository API to v1 2023-03-23 23:17:23 +02:00
oci cosign: allow identity matching for keyless verification 2023-10-31 08:04:34 -07:00
predicates Static helmrepository OCI 2023-11-22 21:05:51 +05:30
reconcile misc: remove redundant nil check 2023-10-11 11:03:55 +02:00
tls helmrepo: fix Secret type check for TLS via `.spec.secretRef` 2023-09-06 00:27:45 +05:30
transport internal/helm/getter: remove transport reuse test 2022-06-14 09:25:52 +01:00
util Refactor internal OCI package 2022-09-20 18:34:02 +03:00