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

Make mysql-tester less verbose/confusing #46

Closed
wants to merge 5 commits into from

Conversation

mjonss
Copy link
Collaborator

@mjonss mjonss commented Jan 7, 2022

close: #45

Decrease the number of lines of succeeded tests by 2/3.
Changed Warn -> Debug: about creating a new db for the test
Changed Info -> Debug: test OK (already a print out-put with OK + number of test cases + time)

From something like:

WARN[0006] Create new db&{0 0xc0004926b0 0 {0 0} [0xc0005f43f0] map[] 0 1 0xc0007e4d80 false map[0xc0005f43f0:map[0xc0005f43f0:true]] map[] 0 0 0 0 <nil> 0 0 0 0 0x48a560} 
./t/gcol_partition.test: ok! 28 test cases passed, take time 0.057652606 s
INFO[0006] run test [gcol_partition] ok                 
WARN[0006] Create new db&{0 0xc0006025d8 0 {0 0} [0xc0008353b0] map[] 0 1 0xc00043ecc0 false map[0xc0008353b0:map[0xc0008353b0:true]] map[] 0 0 0 0 <nil> 0 0 0 0 0x48a560} 
./t/gcol_select.test: ok! 122 test cases passed, take time 0.434359509 s
INFO[0006] run test [gcol_select] ok                    
WARN[0006] ping db failed, retry count 0 err Error 1049: Unknown database 'test' 
WARN[0007] ping db failed, retry count 1 err Error 1049: Unknown database 'test' 
./t/mariadb_cte_nonrecursive.test: ok! 381 test cases passed, take time 1.415000707 s
INFO[0007] run test [mariadb_cte_nonrecursive] ok       
WARN[0007] Create new db&{0 0xc0006022d0 0 {0 0} [0xc000bdc1b0] map[] 0 1 0xc000110720 false map[0xc000bdc1b0:map[0xc000bdc1b0:true]] map[] 0 0 0 0 <nil> 0 0 0 0 0x48a560} 
WARN[0007] Create new db&{0 0xc000602470 0 {0 0} [0xc00097d050] map[] 0 1 0xc001526000 false map[0xc00097d050:map[0xc00097d050:true]] map[] 0 0 0 0 <nil> 0 0 0 0 0x48a560} 
./t/alter_table1.test: ok! 491 test cases passed, take time 5.534970047 s
INFO[0008] run test [alter_table1] ok     

to:

./t/gcol_select.test: ok! 122 test cases passed, take time 0.433417989 s
./t/alter_table1.test: ok! 491 test cases passed, take time 4.182296531 s
WARN[0005] ping db failed, retry count 0 err Error 1049: Unknown database 'test' 
WARN[0005] ping db failed, retry count 1 err Error 1049: Unknown database 'test' 
./t/mariadb_cte_nonrecursive.test: ok! 381 test cases passed, take time 1.394504744 s
./t/alter_table_PK.test: ok! 82 test cases passed, take time 0.827147419 s

Also made make test succeed.

@mjonss
Copy link
Collaborator Author

mjonss commented Jan 7, 2022

/cc @dveeden @morgo could you please review this?

Copy link
Collaborator

@dveeden dveeden left a comment

Choose a reason for hiding this comment

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

The -log-level option seems to be broken. Please apply this patch to fix it:

diff --git a/src/main.go b/src/main.go
index e78f3f6..ff76737 100644
--- a/src/main.go
+++ b/src/main.go
@@ -1010,6 +1010,11 @@ func consumeError() []error {
 func main() {
        flag.Parse()
        tests := flag.Args()
+       intLogLevel, err := log.ParseLevel(logLevel)
+       if err != nil {
+               log.Fatal(err)
+       }
+       log.SetLevel(intLogLevel)
 
        // we will run all tests if no tests assigned
        if len(tests) == 0 {

@dveeden
Copy link
Collaborator

dveeden commented Jan 7, 2022

$ ./mysql-tester test
FATA[0000] Executing create db test err[Error 1007: Can't create database 'test'; database exists] 
$ ./mysql-tester -log-level debug test
INFO[0000] running tests: [test]                        
DEBU[0000] Create new db&{0 0xc0000ba098 0 {0 0} [0xc000300000] map[] 0 1 0xc000096120 false map[0xc000300000:map[0xc000300000:true]] map[] 0 0 0 0 <nil> 0 0 0 0 0x49d0a0} 
FATA[0000] Executing create db test err[Error 1007: Can't create database 'test'; database exists] 
$ ./mysql-tester -log-level info test
INFO[0000] running tests: [test]                        
FATA[0000] Executing create db test err[Error 1007: Can't create database 'test'; database exists] 

dveeden
dveeden previously approved these changes Jan 7, 2022
morgo
morgo previously approved these changes Jan 7, 2022
Copy link
Contributor

@morgo morgo left a comment

Choose a reason for hiding this comment

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

LGTM - I don't have merge privileges on this repo though

@dveeden
Copy link
Collaborator

dveeden commented Jan 7, 2022

@zimulala and @bb7133 might have the right privileges

@dveeden
Copy link
Collaborator

dveeden commented Nov 8, 2022

@mjonss could you fix the conflict?

@mjonss mjonss dismissed stale reviews from morgo and dveeden via 7a3819a November 9, 2022 06:52
@dveeden
Copy link
Collaborator

dveeden commented Dec 7, 2023

@mjonss what are your plans with this PR?

@mjonss
Copy link
Collaborator Author

mjonss commented Dec 7, 2023

@mjonss what are your plans with this PR?

@dveeden I think most of these tweaks are already in the master branch, including lowering the log level for creating databases and fixing the log level in #52. So I'm closing this.

@mjonss mjonss closed this Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unneeded warning for 'Create new db', please move to Debug level.
3 participants