-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Tests fail, timezone weirdness ensues #16
Comments
Could you post the outputs of below codes in your local? package main
import "fmt"
import "time"
func main() {
var t time.Time
fmt.Println(t)
} I guess it is your local problem. |
I think you might be right, though. Looks like the memory is not being zeroed. I'll try with a different distribution of Go (I was encountering this error with 1.1.x https://code.google.com/p/go/issues/detail?id=6515) Most of the timezones actually make it through OK
|
Ok, Thank you. Let me know if there are any updates. I tested gorm with go1.2rc5 (linux gcc 4.8.2) (installed with gvm https://github.com/moovweb/gvm), and all tests passed. So I am going to close the issue first. feel free to reopen it if you still have issue. |
Tested with Go 1.1.2 on Ubuntu linux/amd64 and have the same issue. The problem might be with lib/pq. gorm_test logs:
Postgres logs
I'm going to see if I can get closer to isolating the bug. |
Thank you for your update, hope you could point it out soon. |
Yup, it's in lib/pq. I can reproduce it with this.
Postgres logs
What version of Postgres and lib/pq do you use? It seems to always treat the timezone as "-05:50:36" for me. Even several revisions back. |
I am using latest lib/pq 9fa22d47b017aa81fcfd425900e2c4c48a8170a7 and postgres 9.3.1. |
I have a (nearly) identical issue using the latest gorm, pq, etc. This is Go 1.3.3 on darwin_amd64. I ran the small test file and also received The query looks like this, from the gorm logger:
You'll notice that the The actual error:
I added some debugging statements as deep as right after this line that show that even at this point the same Any ideas? This only happens for this Did you have any luck @jamesharr? I'd appreciate any help you or @jinzhu can provide. |
Hi @bendemaree As I remembered, I have seen similar reports before... but forgot how they fixed it Could you provide a script that could reproduce this issue after pull latests lib/pg, so I could test it myself? |
Sure! I will have something soon that (hopefully) reproduces. |
Hey @jinzhu, I have created a test that fails every time on my machine.
This fails for me every time with
If you create a Postgres database named Thank you very much for investigating! |
Hi @bendemaree I see, seems it is caused by your time zone. and look back @jamesharr's comment
Seems it is lib/pg's issue, maybe you need to open an issue there? |
Actually @jinzhu I think you have the same issue, regardless of timezone. If you look at the I have verified @jamesharr's comment as well. I also see |
Sorry. I should have looked more closely at open issues. lib/pq#251 is open already. |
@jinzhu If you have time, would you review my comments in lib/pq#253? I think that's the issue. I will try and make a pull request soon. |
…#216, and probably go-gorm#99. Also tags go-gorm#10 and go-gorm#20.
I stumbled onto a strange timezone bug while running tests. It could very well be my install of Go. I'm running 1.2rc5 on darwin_amd64. I'll see what I can dig up tomorrow, but I figured I'd write down my notes.
I expanded the test to add some debugging info.
Output:
When I turn on query logging in GORM, I see this:
This is what I see in postgres after the test fails:
Quite a few deleted_at dates have a strange timezone like this (all but one). I'll see what I can dig up tomorrow, but I'm going to crash for tonight.
I think I might also look at checking for query errors in tests. I think this is happening on the products table as well.
The text was updated successfully, but these errors were encountered: