aboutsummaryrefslogtreecommitdiff
path: root/sqlite3_go18_test.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Build with "go tool" and hackishly bundle code from same package into one ↵EuAndreh2024-08-121-504/+0
| | | | file each
* go fmt ./...Yasuhiro Matsumoto2024-01-251-0/+1
|
* TestExecContextCancel: Reduce timeout to make less flaky (#879)Evan Jones2020-11-171-4/+10
| | | | | | | | | | | | | This test fails fairly often. On my system, I can trigger it with: go test . -run=TestExecContextCancel -count=10 -failfast -v This makes the test less flaky by timing out the context after a consistent 50 millisecond delay. This was enough time for the query to start, then get cancelled with sqlite3_interrupt() in my tests. This now passes the above check. This is a modified version of the change suggested in: https://github.com/mattn/go-sqlite3/pull/865
* Fix "cannot start a transaction within a transaction" issue (#764) (#765)Andrii Zavorotnii2020-08-291-1/+39
| | | | | | | | | | | | | | | | | | | | | * Fix "cannot start a transaction within a transaction" issue [why] If db.BeginTx(ctx, nil) context is cancelled too fast, "BEGIN" statement can be completed inside DB, but we still try to cancel it with sqlite3_interrupt. In such case we get context.Cancelled or context.DeadlineExceeded from exec(), but operation really completed. Connection returned into pool, and returns "cannot start a transaction within a transaction" error for next db.BeginTx() call. [how] Handle status code returned from cancelled operation. [testing] Added unit-test which reproduces issue. * Reduce TestQueryRowContextCancelParallel concurrency [why] Tests times out in travis-ci when run with -race option.
* Merge pull request #744 from azavorotnii/ctx_cancelmattn2019-11-191-0/+88
|\ | | | | Fix context cancellation racy handling
| * Fix context cancellation racy handlingAndrii Zavorotnii2019-09-061-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | [why] Context cancellation goroutine is not in sync with Next() method lifetime. It leads to sql.ErrNoRows instead of context.Canceled often (easy to reproduce). It leads to interruption of next query executed on same connection (harder to reproduce). [how] Do query in goroutine, wait when interruption done. [testing] Add unit test that reproduces error cases.
* | Add build constraints for non cgoYasuhiro Matsumoto2019-11-181-2/+2
|/
* Updated Ping to return ErrBadConnMichaelS112019-06-191-0/+215
| | | | | | Added TestOpenContext Added TestFileCopyTruncate Added ping to doTestOpen
* Add Tests for Crypt EncodersGert-Jan Timmer2018-06-121-1/+0
| | | * Increase coverage
* Fix race in ExecContextNiklas Janlert2017-11-211-0/+21
| | | | | When the context is cancelled, an interrupt should only be made if the operation is still ongoing.
* fix testYasuhiro Matsumoto2017-09-281-1/+1
|
* remove rows.Close() in TestShortTimeoutYasuhiro Matsumoto2017-09-281-1/+0
| | | | couldn't reproduce on local environment
* fix broken testYasuhiro Matsumoto2017-09-281-3/+3
|
* fix error handlingYasuhiro Matsumoto2017-09-281-2/+2
| | | | close #464
* use file instead of memory for TestShortTimeoutYasuhiro Matsumoto2017-09-281-14/+9
|
* fixes #458Yasuhiro Matsumoto2017-08-281-0/+92
|
* fix testsYasuhiro Matsumoto2016-12-091-2/+2
|
* fix testYasuhiro Matsumoto2016-12-011-2/+2
| | | | see https://github.com/golang/go/issues/18099
* revert Multiple Result SetYasuhiro Matsumoto2016-11-081-56/+0
|
* fix trace callback.Yasuhiro Matsumoto2016-11-081-0/+56
| | | | Close #352
* go vet && golintYasuhiro Matsumoto2016-11-061-0/+1
|
* separate testYasuhiro Matsumoto2016-11-041-0/+49