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

Generate one log file per minikube command #10425

Merged
merged 3 commits into from
Mar 23, 2021

Conversation

bharathkkb
Copy link
Contributor

fixes #9156 based on #9156 (comment)

  • By default if log_file is not specified, we write to $TMPDIR/minikube_<argv[1]>_<hash>.log
  • if log_dir specified, we write to $LOG_DIR/minikube_<argv[1]>_<hash>.log
  • Any binary runs with same args will result in logs being appended to the same logfile

before

for i in {1..3}; do minikube status; done

creates

minikube.hostname.user.log.INFO.20210209-141816.44848
minikube.hostname.user.log.INFO.20210209-141818.44872
minikube.hostname.user.log.INFO.20210209-141819.44913
minikube.hostname.user.log.WARNING.20210209-141816.44848
minikube.hostname.user.log.WARNING.20210209-141818.44872
minikube.hostname.user.log.WARNING.20210209-141819.44913

each containing

Log file created at: 2021/02/09 14:23:21
Running on machine: hostname
Binary: Built with gc go1.15.7 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg

after

for i in {1..3}; do ./out/minikube status; done

creates

minikube_status_f744034489211de89319363bc95da8daa2870d09.log

containing

Log file created at: 2021/02/09 14:22:15
Running on machine: hostname
Binary: Built with gc go1.14.15 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
Log file created at: 2021/02/09 14:22:16
Running on machine: hostname
Binary: Built with gc go1.14.15 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
Log file created at: 2021/02/09 14:22:16
Running on machine: hostname
Binary: Built with gc go1.14.15 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Feb 9, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @bharathkkb!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @bharathkkb. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 9, 2021
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 9, 2021
@bharathkkb bharathkkb marked this pull request as draft February 9, 2021 20:25
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 9, 2021
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 9, 2021
Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

this is a good PR, thank @bharathkkb for fixing this.

we will need to update the documentation on the https://minikube.sigs.k8s.io/docs/handbook/troubleshooting/
since the command we suggest to find log files wont be correct anymore

find $TMPDIR -mtime -1 -type f -name "*minikube*INFO*" -ls  2>/dev/null

(or can we make it in a way that the same suggestion on the site still works?)
I had to change it to not have the *INFO

 find $TMPDIR -mtime -1 -type f -name "*minikube*" -ls  2>/dev/null 

and I confirmed your fix only creates one file per command.
is it possible that we set a limit on how big this file can be ? maybe do not allow it to be bigger than 1 mb ?

medya@~/workspace/minikube (fix-multiple-log-files) $ cat /var/folders/s8/wxxccj3x7mncysv_zzm5w_r400h78j/T//minikube_version_a24f39ccb0b3c744e7472b70ec1372730a3ee53d.log
Log file created at: 2021/02/12 12:18:27
Running on machine: medya-macbookpro3
Binary: Built with gc go1.15.6 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0212 12:18:27.500643   18787 out.go:229] Setting OutFile to fd 1 ...
I0212 12:18:27.500936   18787 out.go:281] isatty.IsTerminal(1) = true
I0212 12:18:27.500939   18787 out.go:242] Setting ErrFile to fd 2...
I0212 12:18:27.500942   18787 out.go:281] isatty.IsTerminal(2) = true
I0212 12:18:27.501025   18787 root.go:307] Updating PATH: /Users/medya/.minikube/bin
I0212 12:18:27.526953   18787 out.go:119] minikube version: v1.17.1
I0212 12:18:27.551752   18787 out.go:119] commit: a44e009c6d54971d208f2e2789fc8473b0bec789
Log file created at: 2021/02/12 12:18:57
Running on machine: medya-macbookpro3
Binary: Built with gc go1.15.6 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0212 12:18:57.434975   18896 out.go:229] Setting OutFile to fd 1 ...
I0212 12:18:57.435169   18896 out.go:281] isatty.IsTerminal(1) = true
I0212 12:18:57.435172   18896 out.go:242] Setting ErrFile to fd 2...
I0212 12:18:57.435175   18896 out.go:281] isatty.IsTerminal(2) = true
I0212 12:18:57.435264   18896 root.go:307] Updating PATH: /Users/medya/.minikube/bin
I0212 12:18:57.461203   18896 out.go:119] minikube version: v1.17.1
I0212 12:18:57.485673   18896 out.go:119] commit: a44e009c6d54971d208f2e2789fc8473b0bec789
Log file created at: 2021/02/12 12:18:58
Running on machine: medya-macbookpro3
Binary: Built with gc go1.15.6 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0212 12:18:58.228372   18911 out.go:229] Setting OutFile to fd 1 ...
I0212 12:18:58.228561   18911 out.go:281] isatty.IsTerminal(1) = true
I0212 12:18:58.228564   18911 out.go:242] Setting ErrFile to fd 2...
I0212 12:18:58.228567   18911 out.go:281] isatty.IsTerminal(2) = true
I0212 12:18:58.228650   18911 root.go:307] Updating PATH: /Users/medya/.minikube/bin
I0212 12:18:58.254501   18911 out.go:119] minikube version: v1.17.1
I0212 12:18:58.279179   18911 out.go:119] commit: a44e009c6d54971d208f2e2789fc8473b0bec789
Log file created at: 2021/02/12 12:19:23
Running on machine: medya-macbookpro3
Binary: Built with gc go1.15.6 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0212 12:19:23.902215   18946 out.go:229] Setting OutFile to fd 1 ...
I0212 12:19:23.902501   18946 out.go:281] isatty.IsTerminal(1) = true
I0212 12:19:23.902503   18946 out.go:242] Setting ErrFile to fd 2...
I0212 12:19:23.902507   18946 out.go:281] isatty.IsTerminal(2) = true
I0212 12:19:23.902590   18946 root.go:307] Updating PATH: /Users/medya/.minikube/bin
I0212 12:19:23.928504   18946 out.go:119] minikube version: v1.17.1
I0212 12:19:23.953217   18946 out.go:119] commit: a44e009c6d54971d208f2e2789fc8473b0bec789
Log file created at: 2021/02/12 12:19:35
Running on machine: medya-macbookpro3
Binary: Built with gc go1.15.6 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0212 12:19:35.165196   18989 out.go:229] Setting OutFile to fd 1 ...
I0212 12:19:35.165391   18989 out.go:281] isatty.IsTerminal(1) = true
I0212 12:19:35.165393   18989 out.go:242] Setting ErrFile to fd 2...
I0212 12:19:35.165397   18989 out.go:281] isatty.IsTerminal(2) = true
I0212 12:19:35.165479   18989 root.go:307] Updating PATH: /Users/medya/.minikube/bin
I0212 12:19:35.191324   18989 out.go:119] minikube version: v1.17.1
I0212 12:19:35.216018   18989 out.go:119] commit: a44e009c6d54971d208f2e2789fc8473b0bec789
Log file created at: 2021/02/12 12:19:35
Running on machine: medya-macbookpro3
Binary: Built with gc go1.15.6 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0212 12:19:35.818268   19004 out.go:229] Setting OutFile to fd 1 ...
I0212 12:19:35.818565   19004 out.go:281] isatty.IsTerminal(1) = true
I0212 12:19:35.818568   19004 out.go:242] Setting ErrFile to fd 2...
I0212 12:19:35.818571   19004 out.go:281] isatty.IsTerminal(2) = true
I0212 12:19:35.818649   19004 root.go:307] Updating PATH: /Users/medya/.minikube/bin
I0212 12:19:35.844603   19004 out.go:119] minikube version: v1.17.1
I0212 12:19:35.869088   19004 out.go:119] commit: a44e009c6d54971d208f2e2789fc8473b0bec789
Log file created at: 2021/02/12 12:19:36
Running on machine: medya-macbookpro3
Binary: Built with gc go1.15.6 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0212 12:19:36.483261   19019 out.go:229] Setting OutFile to fd 1 ...
I0212 12:19:36.483460   19019 out.go:281] isatty.IsTerminal(1) = true
I0212 12:19:36.483463   19019 out.go:242] Setting ErrFile to fd 2...
I0212 12:19:36.483466   19019 out.go:281] isatty.IsTerminal(2) = true
I0212 12:19:36.483561   19019 root.go:307] Updating PATH: /Users/medya/.minikube/bin
I0212 12:19:36.509380   19019 out.go:119] minikube version: v1.17.1
I0212 12:19:36.534035   19019 out.go:119] commit: a44e009c6d54971d208f2e2789fc8473b0bec789

@medyagh
Copy link
Member

medyagh commented Feb 12, 2021

I really like that every command has its own log file

medya@~/workspace/minikube (fix-multiple-log-files) $ find $TMPDIR -mtime -1 -type f -name "*minikube*" -ls  2>/dev/null 
41323719       16 -rw-r--r--    1 medya            primarygroup         5026 Feb 12 12:19 /var/folders/s8/wxxccj3x7mncysv_zzm5w_r400h78j/T//minikube_version_a24f39ccb0b3c744e7472b70ec1372730a3ee53d.log
41324222        8 -rw-r--r--    1 medya            primarygroup         1430 Feb 12 12:24 /var/folders/s8/wxxccj3x7mncysv_zzm5w_r400h78j/T//minikube_stop_71147ec8404058d0a5eaa842851c91f2c9e7fb78.log

@prezha
Copy link
Contributor

prezha commented Feb 19, 2021

maybe we can have one log file per profile (limited with some max size)?

@medyagh
Copy link
Member

medyagh commented Feb 20, 2021

@bharathkkb I like this PR, would u like to address the TODO and send it for final review to be merged?

@bharathkkb
Copy link
Contributor Author

Hi @medyagh
Just finishing up the tests and will have this up for review shortly.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 21, 2021
@medyagh
Copy link
Member

medyagh commented Feb 22, 2021

CC @spowelljr our new klog expert for a review

@medyagh medyagh requested a review from spowelljr February 22, 2021 09:10
@bharathkkb bharathkkb marked this pull request as ready for review February 22, 2021 19:45
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 22, 2021
@bharathkkb
Copy link
Contributor Author

@medyagh
I have implemented a max size check so it will create a new log file for anything larger than 1M. Also added integration tests

Copy link

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this fix! Left a comment around the integration test.

{
command: "start",
args: append([]string{"--memory=2200", "--wait=true"}, StartArgs()...),
runCount: 20, // calling this 20 times should create 2 files with 1 greater than 1M
Copy link

@priyawadhwa priyawadhwa Feb 25, 2021

Choose a reason for hiding this comment

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

I'm concerned about running minikube start 20 times for this test -- this subtest will take minimum 15 minutes to run.

Instead I would remove the minikube start subtest entirely and run minikube status 100 times (or whatever it takes) to make sure 2 log files are created.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@priyawadhwa did a quick test and for around 500 times x minikube status only generates 87K, so we may need quite a lot of status calls (~5K) to fill up 1M and create 2 files.

Another alternative might be to fill up the log with some mock data(<1M) and expect that minikube handles the creation of new log correctly on subsequent calls. However not sure if that would be a best practice since this is an integration test.

Copy link
Member

@spowelljr spowelljr Feb 25, 2021

Choose a reason for hiding this comment

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

@bharathkkb Maybe try minikube logs much shorter running time than start and generates quite a few logs.

Copy link
Member

Choose a reason for hiding this comment

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

@bharathkkb i really like that added integration test, I agree with @priyawadhwa lets try this test as a Sub Test for TestErrorSpam

we should not start a new cluster for this test, and it goes well with logging and spammming.
since we dont wanna spam TMPFolder

we can have a sub test that runs minikube start --dry-run

or minikube version

{
command: "start",
args: append([]string{"--memory=2200", "--wait=true"}, StartArgs()...),
runCount: 20, // calling this 20 times should create 2 files with 1 greater than 1M
Copy link
Member

Choose a reason for hiding this comment

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

@bharathkkb i really like that added integration test, I agree with @priyawadhwa lets try this test as a Sub Test for TestErrorSpam

we should not start a new cluster for this test, and it goes well with logging and spammming.
since we dont wanna spam TMPFolder

we can have a sub test that runs minikube start --dry-run

or minikube version

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 28, 2021
add max log size, add tests, update website docs

fix func comments

address comments

fix docs

fail fast

add tests to TestErrorSpam, switch to using log
@bharathkkb bharathkkb force-pushed the fix-multiple-log-files branch from 95bf4e9 to 015b721 Compare February 28, 2021 23:12
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 28, 2021
@bharathkkb
Copy link
Contributor Author

@medyagh I have switched this over to a subtest (let me know if this what you had in mind) and instead of start, I have used logs as suggested by @spowelljr

@medyagh
Copy link
Member

medyagh commented Mar 3, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 3, 2021
@kubernetes kubernetes deleted a comment from minikube-pr-bot Mar 3, 2021
@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: 71.4s 67.1s 71.5s
Average time for minikube: 70.0s

Times for Minikube (PR 10425): 71.3s 66.3s 71.5s
Average time for Minikube (PR 10425): 69.7s

Averages Time Per Log

+--------------------------------------------+----------+---------------------+
|                    LOG                     | MINIKUBE | MINIKUBE (PR 10425) |
+--------------------------------------------+----------+---------------------+
| * minikube v1.18.0 on Debian               | 0.0s     | 0.0s                |
| 9.11 (kvm/amd64)                           |          |                     |
| * Using the kvm2 driver based              | 0.0s     | 0.0s                |
| on user configuration                      |          |                     |
| * Starting control plane node              | 0.0s     | 0.0s                |
| minikube in cluster minikube               |          |                     |
| * Creating kvm2 VM (CPUs=2,                | 43.4s    | 43.8s               |
| Memory=3700MB, Disk=20000MB)               |          |                     |
| ...                                        |          |                     |
| * Preparing Kubernetes v1.20.2             | 2.1s     | 2.1s                |
| on Docker 20.10.3 ...                      |          |                     |
|   - Generating certificates                | 3.9s     | 4.0s                |
| and keys ...                               |          |                     |
|   - Booting up control plane               | 16.5s    | 16.0s               |
| ...                                        |          |                     |
|   - Configuring RBAC rules ...             | 1.4s     | 1.4s                |
| * Verifying Kubernetes                     | 0.1s     | 0.1s                |
| components...                              |          |                     |
|   - Using image                            | 1.7s     | 1.5s                |
| gcr.io/k8s-minikube/storage-provisioner:v4 |          |                     |
| * Enabled addons:                          | 0.8s     | 1.0s                |
| storage-provisioner,                       |          |                     |
| default-storageclass                       |          |                     |
| * Done! kubectl is now                     | 0.0s     | 0.0s                |
| configured to use "minikube"               |          |                     |
| cluster and "default"                      |          |                     |
| namespace by default                       |          |                     |
+--------------------------------------------+----------+---------------------+

docker Driver
Times for minikube: 28.0s 27.5s 27.1s
Average time for minikube: 27.5s

Times for Minikube (PR 10425): 27.7s 27.0s 27.1s
Average time for Minikube (PR 10425): 27.3s

Averages Time Per Log

+--------------------------------------------+----------+---------------------+
|                    LOG                     | MINIKUBE | MINIKUBE (PR 10425) |
+--------------------------------------------+----------+---------------------+
| * minikube v1.18.0 on Debian               | 0.2s     | 0.2s                |
| 9.11 (kvm/amd64)                           |          |                     |
| * Using the docker driver                  | 0.1s     | 0.1s                |
| based on user configuration                |          |                     |
| * Starting control plane node              | 0.1s     | 0.1s                |
| minikube in cluster minikube               |          |                     |
| * Creating docker container                | 10.0s    | 9.8s                |
| (CPUs=2, Memory=3700MB) ...                |          |                     |
| * Preparing Kubernetes v1.20.2             | 16.0s    | 15.9s               |
| on Docker 20.10.3 ...                      |          |                     |
| * Verifying Kubernetes                     | 0.1s     | 0.1s                |
| components...                              |          |                     |
|   - Using image                            | 0.9s     | 0.9s                |
| gcr.io/k8s-minikube/storage-provisioner:v4 |          |                     |
| * Enabled addons:                          | 0.1s     | 0.1s                |
| storage-provisioner,                       |          |                     |
| default-storageclass                       |          |                     |
| * Done! kubectl is now                     | 0.0s     | 0.0s                |
| configured to use "minikube"               |          |                     |
| cluster and "default"                      |          |                     |
| namespace by default                       |          |                     |
+--------------------------------------------+----------+---------------------+

@medyagh
Copy link
Member

medyagh commented Mar 6, 2021

@bharathkkb in the test Error Spam I see this


=== CONT  TestErrorSpam/logs
error_spam_test.go:147: (dbg) Done: out/minikube-linux-amd64 logs -p nospam-20210303223533-1048494: (6.383692358s)
error_spam_test.go:161: failed to find expected number of log files: cmd logs: expected: 2 got 6
error_spam_test.go:172: expected to find only one file less than 1M: cmd logs:
error_spam_test.go:197: Cleaning up logfile /tmp/minikube_logs_c0e7076acab36180ef806327f1e14d12ce77a9ec_0.log ...
error_spam_test.go:197: Cleaning up logfile /tmp/minikube_logs_e62f2588220a8558239ba871be07e2c348f43e22_0.log ...
error_spam_test.go:197: Cleaning up logfile /tmp/minikube_logs_e62f2588220a8558239ba871be07e2c348f43e22_1.log ...
error_spam_test.go:197: Cleaning up logfile /tmp/minikube_logs_e62f2588220a8558239ba871be07e2c348f43e22_2.log ...

are we spamming the UI with stderr ?

@medyagh
Copy link
Member

medyagh commented Mar 6, 2021

@bharathkkb lets fix the test and then it looks good

@medyagh
Copy link
Member

medyagh commented Mar 13, 2021

hi @bharathkkb gentel reminder about this PR

@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: 66.0s 63.7s 65.7s
Average time for minikube: 65.1s

Times for Minikube (PR 10425): 65.3s 63.5s 65.9s
Average time for Minikube (PR 10425): 64.9s

Averages Time Per Log

+--------------------------------------------+----------+---------------------+
|                    LOG                     | MINIKUBE | MINIKUBE (PR 10425) |
+--------------------------------------------+----------+---------------------+
| * minikube v1.18.1 on Debian               | 0.0s     |                     |
| 9.11 (kvm/amd64)                           |          |                     |
| * Using the kvm2 driver based              | 0.0s     | 0.0s                |
| on user configuration                      |          |                     |
| * Starting control plane node              | 0.0s     | 0.0s                |
| minikube in cluster minikube               |          |                     |
| * Creating kvm2 VM (CPUs=2,                | 40.2s    | 39.6s               |
| Memory=3700MB, Disk=20000MB)               |          |                     |
| ...                                        |          |                     |
| * Preparing Kubernetes v1.20.2             | 8.4s     | 8.9s                |
| on Docker 20.10.3 ...                      |          |                     |
|   - Generating certificates                | 2.7s     | 2.7s                |
| and keys ...                               |          |                     |
|   - Booting up control plane               | 10.1s    | 9.9s                |
| ...                                        |          |                     |
|   - Configuring RBAC rules ...             | 1.3s     | 1.1s                |
| * Verifying Kubernetes                     | 0.1s     | 0.1s                |
| components...                              |          |                     |
|   - Using image                            | 1.5s     | 1.6s                |
| gcr.io/k8s-minikube/storage-provisioner:v4 |          |                     |
| * Enabled addons:                          | 0.3s     | 1.0s                |
| storage-provisioner,                       |          |                     |
| default-storageclass                       |          |                     |
| * Done! kubectl is now                     | 0.0s     | 0.0s                |
| configured to use "minikube"               |          |                     |
| cluster and "default"                      |          |                     |
| namespace by default                       |          |                     |
+--------------------------------------------+----------+---------------------+

docker Driver
Times for minikube: 27.9s 26.4s 27.2s
Average time for minikube: 27.1s

Times for Minikube (PR 10425): 25.6s 26.4s 27.6s
Average time for Minikube (PR 10425): 26.5s

Averages Time Per Log

+--------------------------------------------+----------+---------------------+
|                    LOG                     | MINIKUBE | MINIKUBE (PR 10425) |
+--------------------------------------------+----------+---------------------+
| * minikube v1.18.1 on Debian               | 0.2s     |                     |
| 9.11 (kvm/amd64)                           |          |                     |
| * Using the docker driver                  | 0.1s     | 0.1s                |
| based on user configuration                |          |                     |
| * Starting control plane node              | 0.1s     | 0.1s                |
| minikube in cluster minikube               |          |                     |
| * Creating docker container                | 9.9s     | 9.6s                |
| (CPUs=2, Memory=3700MB) ...                |          |                     |
| * Preparing Kubernetes v1.20.2             | 15.5s    | 15.5s               |
| on Docker 20.10.3 ...                      |          |                     |
| * Verifying Kubernetes                     | 0.1s     | 0.1s                |
| components...                              |          |                     |
|   - Using image                            | 1.2s     | 0.9s                |
| gcr.io/k8s-minikube/storage-provisioner:v4 |          |                     |
| * Enabled addons:                          | 0.1s     |                     |
| default-storageclass,                      |          |                     |
| storage-provisioner                        |          |                     |
| * Done! kubectl is now                     | 0.0s     | 0.0s                |
| configured to use "minikube"               |          |                     |
| cluster and "default"                      |          |                     |
| namespace by default                       |          |                     |
+--------------------------------------------+----------+---------------------+

test/integration/error_spam_test.go Outdated Show resolved Hide resolved
test/integration/error_spam_test.go Outdated Show resolved Hide resolved
@bharathkkb
Copy link
Contributor Author

@medyagh @spowelljr
I have been trying to look into the failing tests in CI. Part of it was that the logs command was unpredictable w.r.t amount of content being written so I have switched to minikube start --dry-run as @medyagh suggested. I also added a pre step so that any previous run logs are cleaned up and then the tests are run followed by asserting n number of logfiles found.

However looking at the tests I still see that there are cases where the logs could not be cleaned up causing failures. Are the tests being run in parallel on the same runner? Another workaround could be instead of just using the cmd to match logfiles, we can generate the expected SHA and use that to match instead.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bharathkkb, medyagh

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 23, 2021
@medyagh medyagh changed the title feat: add default log file name Generate one log file per minikube command Mar 23, 2021
@medyagh medyagh merged commit f39a3c1 into kubernetes:master Mar 23, 2021
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.

$TMPDIR fills with log files - change logging to create less inodes (add retention)
8 participants