kubernetes/test
Hemant Kumar 74be9f04fa Ensure CleanupActionHandle always completes
The way gingko handles interrupts is:
 - It starts running AfterSuite hooks in a separate goroutine (this includes cleanupAction hooks)
 - Once AfterSuite hook is done executing it calls
   os.Exit(1) on test suite.

So how cleanupFunc() that runs via defer in test can be interrupted
is:
 - cleanupFunc starts running via defer (or AfterEach hook) but first
   thing that function does is to remove cleanupHandle from
   framework.RemoveCleanupAction.
 - Test suite receives interrupt from user and AfterSuite block
   starts executing
 - remember that while cleanupFunc is running in goroutine#1,
   AfterSuite is running concurrently in goroutine#2.
 - AfterSuite hook has bunch of CleanupActions it needs to run which
   were registered via framework.AddCleanupAction(cleanupFunc) but
   once cleanupFunc starts executing via defer in the test, it will
   remove the cleanupHandle from framework's aftersuite hooks.
 - So if AfterSuite did not had anything to run (because
   those actions were removed via framework.RemoveCleanupAction
   then it will simply go to the last framework.AfterEach action and call os.Exit(1)
 - So if os.Exit(1) is called before cleanupFunc has a chance to finish in defer, it will not complete.
2020-06-02 12:40:32 -04:00
..
cmd Merge pull request #91308 from julianvmodesto/remove-deprecated-server-dry-run-flag 2020-05-29 01:05:35 -07:00
conformance Merge pull request #89716 from Jefftree/bdd-initial-link 2020-05-26 23:24:41 -07:00
e2e Ensure CleanupActionHandle always completes 2020-06-02 12:40:32 -04:00
e2e_kubeadm Run hack/update-vendor.sh 2020-05-16 07:54:33 -04:00
e2e_node Merge pull request #91363 from alejandrox1/tune-node-perf-workloads 2020-05-30 23:25:53 -07:00
fixtures Remove support for basic authentication 2020-03-11 20:55:47 -04:00
fuzz Fix validation for metav1 fuzz targets. 2019-10-28 17:50:29 -04:00
images Run hack/update-vendor.sh 2020-05-16 07:54:33 -04:00
instrumentation Merge pull request #84373 from serathius/metrics-stability-variables 2020-01-09 20:12:49 -08:00
integration Merge pull request #91502 from deads2k/dyn-audit-removal-00 2020-05-29 11:56:20 -07:00
kubemark Update kube-addon-manager to v9.1.1 2020-05-20 09:50:20 +02:00
list
soak/serve_hostnames Run hack/update-vendor.sh 2020-05-16 07:54:33 -04:00
typecheck Do not include bazel related deps in root go.mod 2020-04-19 22:01:50 -04:00
utils remove-api 2020-05-27 16:58:05 -04:00
BUILD Added go-fuzz target for json serializer Encode/Decode. 2019-10-18 09:11:43 -07:00
OWNERS add tanjunchen as /test reviewer 2020-03-27 22:56:21 +08:00