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

Write commands to audit log regardless of whether it terminates cleanly #13307

Merged
merged 7 commits into from
Jun 17, 2022

Conversation

NikhilSharmaWe
Copy link
Member

@NikhilSharmaWe NikhilSharmaWe commented Jan 6, 2022

Fixes #13186

Before (note start entry is not present):

$ minikube delete
🙄  "minikube" profile does not exist, trying anyways.
💀  Removed all traces of the "minikube" cluster.
$ minikube delete
🙄  "minikube" profile does not exist, trying anyways.
💀  Removed all traces of the "minikube" cluster.
$ minikube start --driver docker
😄  minikube v1.26.0-beta.1 on Darwin 12.4
✨  Using the docker driver based on user configuration

💣  Exiting due to PROVIDER_DOCKER_NOT_RUNNING: "docker version --format -" exit status 1: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
💡  Suggestion: Start the Docker service
📘  Documentation: https://minikube.sigs.k8s.io/docs/drivers/docker/

$ minikube logs --audit

==> Audit <==
|---------|------|----------|--------------|----------------|---------------------|---------------------|
| Command | Args | Profile  |     User     |    Version     |     Start Time      |      End Time       |
|---------|------|----------|--------------|----------------|---------------------|---------------------|
| delete  |      | minikube | powellsteven | v1.26.0-beta.1 | 14 Jun 22 15:44 PDT | 14 Jun 22 15:44 PDT |
| delete  |      | minikube | powellsteven | v1.26.0-beta.1 | 14 Jun 22 15:44 PDT | 14 Jun 22 15:44 PDT |
|---------|------|----------|--------------|----------------|---------------------|---------------------|

After (note start entry is present):

$ minikube delete
🙄  "minikube" profile does not exist, trying anyways.
💀  Removed all traces of the "minikube" cluster.
$ minikube delete
🙄  "minikube" profile does not exist, trying anyways.
💀  Removed all traces of the "minikube" cluster.
$ minikube start --driver docker
😄  minikube v1.26.0-beta.1 on Darwin 12.4
✨  Using the docker driver based on user configuration

💣  Exiting due to PROVIDER_DOCKER_NOT_RUNNING: "docker version --format -" exit status 1: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
💡  Suggestion: Start the Docker service
📘  Documentation: https://minikube.sigs.k8s.io/docs/drivers/docker/

$ minikube logs --audit

==> Audit <==
|---------|-----------------|----------|--------------|----------------|---------------------|---------------------|
| Command |      Args       | Profile  |     User     |    Version     |     Start Time      |      End Time       |
|---------|-----------------|----------|--------------|----------------|---------------------|---------------------|
| delete  |                 | minikube | powellsteven | v1.26.0-beta.1 | 14 Jun 22 15:42 PDT | 14 Jun 22 15:42 PDT |
| delete  |                 | minikube | powellsteven | v1.26.0-beta.1 | 14 Jun 22 15:42 PDT | 14 Jun 22 15:42 PDT |
| start   | --driver docker | minikube | powellsteven | v1.26.0-beta.1 | 14 Jun 22 15:42 PDT |                     |
|---------|-----------------|----------|--------------|----------------|---------------------|---------------------|

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 6, 2022
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@spowelljr
Copy link
Member

@NikhilSharmaWe

Error: cmd/minikube/cmd/root.go:26:2: "time" imported but not used (typecheck)
	"time"
	^
Error: pkg/minikube/audit/audit.go:57:3: wrong number of return values (want 1, got 0) (typecheck)
		return
		^
Error: pkg/minikube/audit/audit.go:70:11: no result values expected (typecheck)
			return nil, fmt.Errorf("failed to set the log file: %v", err)
			       ^
Error: pkg/minikube/audit/audit.go:73:31: cannot use currentLogFile (variable of type *os.File) as []string value in argument to logsToRows (typecheck)
	for _, v := range logsToRows(currentLogFile) {
	                             ^
Error: pkg/minikube/audit/audit_test.go:178:3: undeclared name: `Log` (typecheck)
		Log(time.Now())
		^
Error: pkg/minikube/audit/logFile_test.go:51:62: cannot use time.Now() (value of type time.Time) as string value in argument to newRow (typecheck)
		r := newRow("start", "-v", "user1", "v0.17.1", time.Now(), time.Now())
		                                                           ^
Error: pkg/minikube/audit/row_test.go:40:30: cannot use et (variable of type time.Time) as string value in argument to newRow (typecheck)
	r := newRow(c, a, u, v, st, et, p)

You can check for these failures locally by running make test

@NikhilSharmaWe
Copy link
Member Author

@spowelljr Yes thanks, I am working on them.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 6, 2022
return fmt.Errorf("failed to set the log file: %v", err)
}
}
auditLogs, err := logsToRows(currentLogFile)
Copy link
Member Author

@NikhilSharmaWe NikhilSharmaWe Jan 6, 2022

Choose a reason for hiding this comment

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

@spowelljr How can we convert currentLogFile from *os.File type to []string type ?

We can use ioutil.ReadFile() function for converting it to []byte and then string but how can we convert it to []string type so that we can convert to []row through logsToRows() function.

Copy link
Member

@spowelljr spowelljr Jan 6, 2022

Choose a reason for hiding this comment

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

You can use https://pkg.go.dev/encoding/json#Unmarshal to convert []byte to a struct (row).

@NikhilSharmaWe
Copy link
Member Author

NikhilSharmaWe commented Jan 7, 2022

@spowelljr We are getting error where funcs Log() and newRow() were used other than audit.go and root.go. When previously I checked Log() function was not used any other place than root.go but now I think it is not the case.

  • I think we should add functions Log() and newRow()(with older logic) along side with the new functions which we have added. I will change name of newRow() function which we have used in LogCommandStart() to newRowStart().

Could you please give your thoughts on this.

@spowelljr
Copy link
Member

@spowelljr We are getting error where funcs Log() and newRow() were used other than audit.go and root.go. When previously I checked Log() function was not used any other place than root.go but now I think it is not the case.

  • I think we should add functions Log() and newRow()(with older logic) along side with the new functions which we have added. I will change name of newRow() function which we have used in LogCommandStart() to newRowStart().

Could you please give your thoughts on this.

Those are the audit test files that are giving you errors, they need to updated as the func changes.

@NikhilSharmaWe
Copy link
Member Author

NikhilSharmaWe commented Jan 7, 2022

@spowelljr
Could you please review the changes I have made in test files.
Am I going in the right direction through these changes ?

cmd/minikube/cmd/root.go Outdated Show resolved Hide resolved
cmd/minikube/cmd/root.go Outdated Show resolved Hide resolved
pkg/minikube/audit/audit.go Outdated Show resolved Hide resolved
pkg/minikube/audit/audit.go Outdated Show resolved Hide resolved
pkg/minikube/audit/audit.go Outdated Show resolved Hide resolved
pkg/minikube/audit/audit.go Outdated Show resolved Hide resolved
pkg/minikube/audit/audit.go Show resolved Hide resolved
pkg/minikube/audit/audit.go Show resolved Hide resolved
pkg/minikube/audit/audit_test.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 8, 2022
@minikube-pr-bot
Copy link

timing minikube failed, please try again

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_Linux_containerd TestAddons/serial (gopogh) n/a
Docker_Windows TestFunctional/parallel/DashboardCmd (gopogh) n/a
Docker_Windows TestFunctional/parallel/UpdateContextCmd (gopogh) n/a
Docker_Linux_containerd TestAddons/StoppedEnableDisable (gopogh) 0.00 (chart)
Docker_Windows TestFunctional/parallel/AddonsCmd (gopogh) 0.00 (chart)
Docker_Windows TestFunctional/parallel/ConfigCmd (gopogh) 0.00 (chart)
Docker_Windows TestFunctional/parallel/DryRun (gopogh) 0.00 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageRemove (gopogh) 0.00 (chart)
Docker_Windows TestFunctional/parallel/InternationalLanguage (gopogh) 0.00 (chart)
Docker_Windows TestFunctional/parallel/ProfileCmd/profile_json_output (gopogh) 0.00 (chart)
Docker_Windows TestFunctional/parallel/ProfileCmd/profile_list (gopogh) 0.00 (chart)
Docker_Windows TestFunctional/parallel/ProfileCmd/profile_not_create (gopogh) 0.00 (chart)
Docker_Windows TestFunctional/parallel/Version/short (gopogh) 0.00 (chart)
Docker_Windows TestIngressAddonLegacy/serial/ValidateIngressDNSAddonActivation (gopogh) 0.00 (chart)
Docker_Windows TestKicCustomNetwork/use_default_bridge_network (gopogh) 0.00 (chart)
KVM_Linux_containerd TestAddons/serial/GCPAuth (gopogh) 0.00 (chart)
Docker_Linux_containerd TestAddons/parallel/Registry (gopogh) 17.44 (chart)
Docker_Windows TestAddons/Setup (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/CertSync (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/CpCmd (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/DockerEnv/powershell (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/FileSync (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageBuild (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListJson (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListShort (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListTable (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListYaml (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageLoadDaemon (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageLoadFromFile (gopogh) 48.57 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageReloadDaemon (gopogh) 48.57 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

To see the flake rates of all tests by environment, click here.

@spowelljr spowelljr removed the do-not-merge/failing-test Indicates that a PR should not merge because it has a failing test label Jun 14, 2022
@sharifelgamal sharifelgamal changed the title Made changes so that we get logs when a command starts no matter that it is finished or not Write commands to audit log regardless of whether it terminates cleanly Jun 14, 2022
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13307) |
+----------------+----------+---------------------+
| minikube start | 51.7s    | 51.2s               |
| enable ingress | 28.1s    | 27.6s               |
+----------------+----------+---------------------+

Times for minikube start: 53.9s 50.1s 51.4s 51.7s 51.4s
Times for minikube (PR 13307) start: 51.2s 50.8s 49.8s 52.3s 51.8s

Times for minikube ingress: 29.6s 26.6s 29.7s 26.1s 28.6s
Times for minikube (PR 13307) ingress: 29.6s 29.1s 25.1s 26.1s 28.1s

docker driver with docker runtime
error collecting results for docker driver: timing run 0 with minikube: timing cmd: [out/minikube addons enable ingress]: waiting for minikube: exit status 10
docker driver with containerd runtime
error collecting results for docker driver: timing run 0 with minikube: timing cmd: [out/minikube addons enable ingress]: waiting for minikube: exit status 10

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 14, 2022
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13307) |
+----------------+----------+---------------------+
| minikube start | 51.9s    | 51.5s               |
| enable ingress | 27.2s    | 28.1s               |
+----------------+----------+---------------------+

Times for minikube (PR 13307) ingress: 29.3s 29.3s 28.4s 25.3s 28.3s
Times for minikube ingress: 29.6s 26.1s 25.5s 26.0s 28.5s

Times for minikube start: 52.8s 50.9s 51.1s 52.2s 52.4s
Times for minikube (PR 13307) start: 51.8s 51.9s 50.2s 52.0s 51.9s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13307) |
+----------------+----------+---------------------+
| minikube start | 30.3s    | 24.7s               |
| enable ingress | 34.6s    | 22.2s               |
+----------------+----------+---------------------+

Times for minikube start: 52.6s 24.0s 25.2s 24.6s 25.1s
Times for minikube (PR 13307) start: 25.6s 23.9s 24.8s 24.7s 24.5s

Times for minikube ingress: 22.9s 22.4s 21.9s 22.4s 83.4s
Times for minikube (PR 13307) ingress: 23.2s 21.7s 21.2s 22.1s 22.7s

docker driver with containerd runtime

+-------------------+----------+---------------------+
|      COMMAND      | MINIKUBE | MINIKUBE (PR 13307) |
+-------------------+----------+---------------------+
| minikube start    | 33.3s    | 32.4s               |
| ⚠️  enable ingress | 20.6s    | 28.6s ⚠️             |
+-------------------+----------+---------------------+

Times for minikube start: 29.8s 32.4s 34.2s 40.2s 29.7s
Times for minikube (PR 13307) start: 29.1s 39.7s 32.0s 33.0s 28.3s

Times for minikube ingress: 22.4s 17.9s 18.4s 22.4s 22.0s
Times for minikube (PR 13307) ingress: 22.2s 22.2s 18.7s 47.7s 32.2s

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13307) |
+----------------+----------+---------------------+
| minikube start | 51.7s    | 51.9s               |
| enable ingress | 34.4s    | 30.9s               |
+----------------+----------+---------------------+

Times for minikube ingress: 25.6s 27.1s 29.1s 59.6s 30.6s
Times for minikube (PR 13307) ingress: 30.2s 28.7s 28.7s 36.7s 30.3s

Times for minikube start: 53.8s 50.7s 50.6s 51.5s 51.7s
Times for minikube (PR 13307) start: 51.9s 54.1s 51.0s 51.9s 50.7s

docker driver with docker runtime
error collecting results for docker driver: timing run 0 with minikube: timing cmd: [out/minikube addons enable ingress]: waiting for minikube: exit status 10
docker driver with containerd runtime
error collecting results for docker driver: timing run 0 with minikube: timing cmd: [out/minikube addons enable ingress]: waiting for minikube: exit status 10

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_Windows TestFunctional/parallel/ConfigCmd (gopogh) 0.00 (chart)
Hyper-V_Windows TestErrorSpam/setup (gopogh) 0.00 (chart)
Hyper-V_Windows TestFunctional/parallel/ConfigCmd (gopogh) 0.00 (chart)
Hyper-V_Windows TestNetworkPlugins/group/enable-default-cni/KubeletFlags (gopogh) 0.00 (chart)
Hyperkit_macOS TestMultiNode/serial/RestartMultiNode (gopogh) 0.64 (chart)
Hyper-V_Windows TestAddons/parallel/Registry (gopogh) 0.82 (chart)
Hyper-V_Windows TestFunctional/parallel/ImageCommands/ImageLoadFromFile (gopogh) 1.64 (chart)
Hyperkit_macOS TestMultiNode/serial/DeleteNode (gopogh) 1.91 (chart)
Hyperkit_macOS TestMultiNode/serial/DeployApp2Nodes (gopogh) 1.91 (chart)
Hyperkit_macOS TestMultiNode/serial/PingHostFrom2Pods (gopogh) 1.91 (chart)
Hyperkit_macOS TestMultiNode/serial/ProfileList (gopogh) 1.91 (chart)
Hyperkit_macOS TestMultiNode/serial/StopNode (gopogh) 1.91 (chart)
Hyperkit_macOS TestIngressAddonLegacy/serial/ValidateIngressAddonActivation (gopogh) 2.55 (chart)
Hyperkit_macOS TestMultiNode/serial/RestartKeepsNodes (gopogh) 2.55 (chart)
Hyperkit_macOS TestMultiNode/serial/FreshStart2Nodes (gopogh) 3.18 (chart)
Hyperkit_macOS TestIngressAddonLegacy/serial/ValidateIngressAddons (gopogh) 5.10 (chart)
Hyperkit_macOS TestMultiNode/serial/AddNode (gopogh) 6.37 (chart)
Hyperkit_macOS TestMultiNode/serial/StartAfterStop (gopogh) 6.37 (chart)
Docker_Cloud_Shell TestStartStop/group/cloud-shell/serial/SecondStart (gopogh) 13.46 (chart)
Hyper-V_Windows TestNetworkPlugins/group/flannel/Start (gopogh) 19.67 (chart)
Docker_macOS TestFunctional/parallel/DashboardCmd (gopogh) 20.63 (chart)
Hyperkit_macOS TestFunctional/parallel/DashboardCmd (gopogh) 22.93 (chart)
Hyper-V_Windows TestNetworkPlugins/group/bridge/Start (gopogh) 31.97 (chart)
Hyperkit_macOS TestSkaffold (gopogh) 36.31 (chart)
Docker_macOS TestSkaffold (gopogh) 38.89 (chart)
Hyper-V_Windows TestNetworkPlugins/group/kubenet/Start (gopogh) 40.98 (chart)
Docker_Windows TestMinikubeProfile (gopogh) 48.03 (chart)
Docker_Windows TestAddons/Setup (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/CertSync (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/CpCmd (gopogh) 48.67 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

To see the flake rates of all tests by environment, click here.

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Hyperkit_macOS TestFunctional/parallel/ImageCommands/ImageLoadDaemon (gopogh) 1.27 (chart)
Hyperkit_macOS TestFunctional/parallel/ImageCommands/ImageLoadFromFile (gopogh) 1.27 (chart)
Hyperkit_macOS TestFunctional/parallel/ImageCommands/ImageReloadDaemon (gopogh) 1.27 (chart)
Hyperkit_macOS TestFunctional/parallel/ImageCommands/ImageSaveDaemon (gopogh) 1.27 (chart)
Hyperkit_macOS TestFunctional/parallel/ImageCommands/ImageSaveToFile (gopogh) 1.27 (chart)
Hyperkit_macOS TestFunctional/parallel/ImageCommands/ImageTagAndLoadDaemon (gopogh) 1.27 (chart)
Hyperkit_macOS TestFunctional/parallel/ImageCommands/Setup (gopogh) 1.27 (chart)
Docker_Linux_containerd TestNetworkPlugins/group/auto/DNS (gopogh) 12.87 (chart)
Docker_Linux_containerd TestPause/serial/Start (gopogh) 25.74 (chart)
Docker_Linux_containerd TestAddons/Setup (gopogh) 27.94 (chart)
Docker_Linux_containerd TestIngressAddonLegacy/serial/ValidateIngressAddonActivation (gopogh) 27.94 (chart)
Docker_Linux_containerd TestIngressAddonLegacy/StartLegacyK8sCluster (gopogh) 27.94 (chart)
Docker_Linux_containerd TestJSONOutput/start/Command (gopogh) 27.94 (chart)
Docker_Linux_containerd TestMultiNode/serial/AddNode (gopogh) 27.94 (chart)
Docker_Linux_containerd TestMultiNode/serial/DeleteNode (gopogh) 27.94 (chart)
Docker_Linux_containerd TestMultiNode/serial/FreshStart2Nodes (gopogh) 27.94 (chart)
Docker_Linux_containerd TestMultiNode/serial/ProfileList (gopogh) 27.94 (chart)
Docker_Linux_containerd TestMultiNode/serial/RestartKeepsNodes (gopogh) 27.94 (chart)
Docker_Linux_containerd TestMultiNode/serial/RestartMultiNode (gopogh) 27.94 (chart)
Docker_Linux_containerd TestMultiNode/serial/StartAfterStop (gopogh) 27.94 (chart)
Docker_Linux_containerd TestMultiNode/serial/StopNode (gopogh) 27.94 (chart)
Docker_Linux_containerd TestPreload (gopogh) 27.94 (chart)
Docker_Linux_containerd TestFunctional/parallel/MountCmd/any-port (gopogh) 32.35 (chart)
Docker_Linux_containerd TestFunctional/parallel/MySQL (gopogh) 32.35 (chart)
Docker_Linux_containerd TestFunctional/parallel/PersistentVolumeClaim (gopogh) 32.35 (chart)
Docker_Linux_containerd TestFunctional/parallel/ServiceCmd (gopogh) 32.35 (chart)
Docker_Linux_containerd TestFunctional/parallel/ServiceCmdConnect (gopogh) 32.35 (chart)
Docker_Linux_containerd TestFunctional/parallel/TunnelCmd/serial/AccessDirect (gopogh) 32.35 (chart)
Docker_Linux_containerd TestFunctional/parallel/TunnelCmd/serial/WaitService/Setup (gopogh) 32.35 (chart)
Docker_Linux_containerd TestFunctional/serial/ExtraConfig (gopogh) 32.35 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

To see the flake rates of all tests by environment, click here.

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
KVM_Linux TestPause/serial/PauseAgain (gopogh) 0.63 (chart)
Docker_macOS TestFunctional/parallel/PersistentVolumeClaim (gopogh) 0.79 (chart)
Docker_macOS TestFunctional/parallel/TunnelCmd/serial/AccessDirect (gopogh) 0.79 (chart)
Docker_macOS TestFunctional/parallel/TunnelCmd/serial/WaitService/Setup (gopogh) 0.79 (chart)
Docker_Linux_containerd TestNetworkPlugins/group/kindnet/DNS (gopogh) 16.67 (chart)
Docker_macOS TestFunctional/parallel/DashboardCmd (gopogh) 20.63 (chart)
Hyperkit_macOS TestSkaffold (gopogh) 36.31 (chart)
Docker_macOS TestSkaffold (gopogh) 38.89 (chart)
Hyper-V_Windows TestNoKubernetes/serial/StartWithK8s (gopogh) 43.44 (chart)
Docker_Windows TestMinikubeProfile (gopogh) 48.03 (chart)
Docker_Windows TestAddons/Setup (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/CertSync (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/CpCmd (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/DockerEnv/powershell (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/FileSync (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageBuild (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListJson (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListShort (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListTable (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageListYaml (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageLoadDaemon (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageLoadFromFile (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageReloadDaemon (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageSaveDaemon (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageSaveToFile (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/ImageTagAndLoadDaemon (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/ImageCommands/Setup (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/MySQL (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/NodeLabels (gopogh) 48.67 (chart)
Docker_Windows TestFunctional/parallel/NonActiveRuntimeDisabled (gopogh) 48.67 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

To see the flake rates of all tests by environment, click here.

@spowelljr
Copy link
Member

The problem is we were leaving the audit log file for the entirety of the command run. The issue is Windows can only truncate a file when it's closed, so if you have more than one command running at the same time (always happening during testing) if one command completes it tried to truncate the log but the other command has it open so the truncation fails. Refactored the code so we only have the audit log open for the minimum required amount of time required before closing it again.

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13307) |
+----------------+----------+---------------------+
| minikube start | 51.3s    | 51.3s               |
| enable ingress | 26.9s    | 27.0s               |
+----------------+----------+---------------------+

Times for minikube start: 50.7s 52.7s 51.5s 50.3s 51.5s
Times for minikube (PR 13307) start: 50.3s 51.3s 51.7s 51.3s 52.0s

Times for minikube (PR 13307) ingress: 25.1s 25.1s 30.1s 25.2s 29.6s
Times for minikube ingress: 25.0s 28.6s 29.1s 25.5s 26.5s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13307) |
+----------------+----------+---------------------+
| minikube start | 23.9s    | 24.8s               |
| enable ingress | 34.8s    | 21.8s               |
+----------------+----------+---------------------+

Times for minikube start: 24.1s 23.9s 24.3s 23.6s 23.7s
Times for minikube (PR 13307) start: 24.6s 24.4s 25.6s 24.3s 25.1s

Times for minikube (PR 13307) ingress: 22.1s 22.0s 20.0s 23.0s 22.0s
Times for minikube ingress: 22.4s 25.9s 22.0s 22.9s 80.9s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13307) |
+----------------+----------+---------------------+
| minikube start | 35.5s    | 37.6s               |
| enable ingress | 22.9s    | 23.4s               |
+----------------+----------+---------------------+

Times for minikube (PR 13307) ingress: 28.0s 16.9s 22.5s 31.5s 18.0s
Times for minikube ingress: 16.9s 31.4s 27.0s 21.5s 17.9s

Times for minikube start: 32.4s 28.2s 44.0s 28.9s 43.9s
Times for minikube (PR 13307) start: 31.7s 43.8s 40.0s 40.1s 32.4s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_macOS TestCertExpiration (gopogh) 0.00 (chart)
Docker_macOS TestCertOptions (gopogh) 0.00 (chart)
Docker_macOS TestDockerFlags (gopogh) 0.00 (chart)
Docker_macOS TestForceSystemdEnv (gopogh) 0.00 (chart)
Docker_macOS TestForceSystemdFlag (gopogh) 0.00 (chart)
Docker_macOS TestStoppedBinaryUpgrade/MinikubeLogs (gopogh) 0.00 (chart)
Docker_macOS TestNoKubernetes/serial/Start (gopogh) 1.59 (chart)
Docker_macOS TestNoKubernetes/serial/StartNoArgs (gopogh) 1.59 (chart)
Docker_macOS TestNoKubernetes/serial/StartWithK8s (gopogh) 1.59 (chart)
Docker_macOS TestNoKubernetes/serial/StartWithStopK8s (gopogh) 1.59 (chart)
Docker_macOS TestNoKubernetes/serial/Stop (gopogh) 1.59 (chart)
Docker_macOS TestPause/serial/Start (gopogh) 1.59 (chart)
Docker_macOS TestNetworkPlugins/group/auto/Start (gopogh) 1.61 (chart)
Docker_macOS TestNetworkPlugins/group/bridge/Start (gopogh) 1.61 (chart)
Docker_macOS TestNetworkPlugins/group/enable-default-cni/Start (gopogh) 1.61 (chart)
Docker_macOS TestNetworkPlugins/group/kindnet/Start (gopogh) 1.61 (chart)
Docker_macOS TestNetworkPlugins/group/kubenet/Start (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/default-k8s-different-port/serial/AddonExistsAfterStop (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/default-k8s-different-port/serial/DeployApp (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/default-k8s-different-port/serial/EnableAddonAfterStop (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/default-k8s-different-port/serial/EnableAddonWhileActive (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/default-k8s-different-port/serial/FirstStart (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/default-k8s-different-port/serial/SecondStart (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/default-k8s-different-port/serial/Stop (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/default-k8s-different-port/serial/UserAppExistsAfterStop (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/default-k8s-different-port/serial/VerifyKubernetesImages (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/embed-certs/serial/AddonExistsAfterStop (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/embed-certs/serial/DeployApp (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/embed-certs/serial/EnableAddonAfterStop (gopogh) 1.61 (chart)
Docker_macOS TestStartStop/group/embed-certs/serial/EnableAddonWhileActive (gopogh) 1.61 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

To see the flake rates of all tests by environment, click here.

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13307) |
+----------------+----------+---------------------+
| minikube start | 51.5s    | 51.3s               |
| enable ingress | 27.0s    | 28.3s               |
+----------------+----------+---------------------+

Times for minikube ingress: 25.6s 26.1s 26.5s 29.0s 28.0s
Times for minikube (PR 13307) ingress: 29.5s 29.0s 28.6s 29.6s 25.0s

Times for minikube start: 51.7s 52.2s 50.9s 52.3s 50.6s
Times for minikube (PR 13307) start: 51.7s 51.7s 50.2s 50.8s 51.9s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13307) |
+----------------+----------+---------------------+
| minikube start | 24.4s    | 24.3s               |
| enable ingress | 24.2s    | 22.5s               |
+----------------+----------+---------------------+

Times for minikube ingress: 25.4s 23.4s 23.9s 24.9s 23.4s
Times for minikube (PR 13307) ingress: 22.9s 22.9s 22.0s 22.9s 21.9s

Times for minikube start: 24.6s 24.9s 24.6s 24.2s 23.9s
Times for minikube (PR 13307) start: 25.0s 24.5s 24.1s 23.5s 24.2s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13307) |
+----------------+----------+---------------------+
| minikube start | 32.5s    | 32.5s               |
| enable ingress | 23.8s    | 20.8s               |
+----------------+----------+---------------------+

Times for minikube ingress: 18.4s 22.4s 32.4s 22.9s 22.9s
Times for minikube (PR 13307) ingress: 18.0s 21.9s 18.4s 23.4s 22.4s

Times for minikube start: 43.7s 28.3s 28.3s 32.9s 29.1s
Times for minikube (PR 13307) start: 43.7s 28.9s 32.1s 28.3s 29.3s

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: NikhilSharmaWe, sharifelgamal

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@spowelljr spowelljr merged commit 8dac72b into kubernetes:master Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audit log defer not always being called
7 participants