2019-11-30 18:36:10 +00:00
|
|
|
/tmp
|
2019-05-22 21:16:55 +00:00
|
|
|
/tags
|
|
|
|
/pkg
|
|
|
|
*.pprof
|
|
|
|
/bin
|
|
|
|
.idea
|
2021-12-21 10:09:14 +00:00
|
|
|
.vscode
|
2019-05-22 21:16:55 +00:00
|
|
|
*.test
|
|
|
|
*.swp
|
2024-07-29 12:29:15 +00:00
|
|
|
/vmdocs
|
2019-05-22 21:16:55 +00:00
|
|
|
/gocache-for-docker
|
2023-07-20 23:21:47 +00:00
|
|
|
/victoria-logs-data
|
2019-05-22 21:16:55 +00:00
|
|
|
/victoria-metrics-data
|
2020-02-23 11:35:47 +00:00
|
|
|
/vmagent-remotewrite-data
|
2019-05-22 21:16:55 +00:00
|
|
|
/vmstorage-data
|
|
|
|
/vmselect-cache
|
2019-07-22 14:12:48 +00:00
|
|
|
/package/temp-deb-*
|
2019-07-25 20:47:41 +00:00
|
|
|
/package/temp-rpm-*
|
2019-07-22 14:12:48 +00:00
|
|
|
/package/*.deb
|
2019-07-25 20:47:41 +00:00
|
|
|
/package/*.rpm
|
2021-05-10 08:38:56 +00:00
|
|
|
.DS_store
|
2021-07-27 15:01:12 +00:00
|
|
|
Gemfile.lock
|
|
|
|
/_site
|
2022-10-06 12:04:25 +00:00
|
|
|
_site
|
2023-07-20 08:10:55 +00:00
|
|
|
*.tmp
|
2024-06-26 15:33:38 +00:00
|
|
|
/docs/.jekyll-metadata
|
2024-07-11 10:39:42 +00:00
|
|
|
coverage.txt
|
|
|
|
cspell.json
|
testing: allow disabling fsync to make tests run faster (#6871)
### Describe Your Changes
fsync() ensures that the data is written to disk. In production this is
needed for data durability. However, during the development, when the
unit tests are run, this level of durability is not needed. Therefore
fsync() can be disabled which will makes test runs two times faster.
The disabling is done by setting the `DISABLE_FSYNC_FOR_TESTING`
environment variable. The valid values for this variable are the same as
the values of the arg of `go doc strconv.ParseBool`:
```
1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.
```
Any other value means `false`.
The variable is set for all test build targets. Compare running times:
Build Target | DISABLE_FSYNC_FOR_TESTING=0 | DISABLE_FSYNC_FOR_TESTING=1
----------------- | ------------------------------------------------ |
-------------------------------------------------
make test | 1m5s | 0m22s
make test-race | 3m1s | 1m42s
make test-pure | 1m7s | 0m20s
make test-full | 1m21s | 0m32s
make test-full-386 | 1m42s | 0m36s
When running tests for a given package, fsync can be disabled as
follows:
```shell
DISABLE_FSYNC_FOR_TESTING=1 go test ./lib/storage
```
Disabling fsync() is intended for testing purposes only and the name of
the variables reflects that.
What could also have been done but haven't:
- lib/filestream/filestream.go: `Writer.MustFlush()` also uses f.Sync()
but nothing has been done to it, because the Writer.MustFlush() is not
used anywhere in the VM codebase. A side question: what is the general
policy for the unused code?
- lib/filestream/filestream.go: Writer.Write() calls `adviceDontNeed()`
which calls unix.Fdatasync(). Disabling it could potentially improve
running time, but running tests with this code disabled has shown
otherwise.
### Checklist
The following checks are **mandatory**:
- [ x] My change adheres [VictoriaMetrics contributing
guidelines](https://docs.victoriametrics.com/contributing/).
---------
Signed-off-by: Artem Fetishev <wwctrsrx@gmail.com>
2024-08-30 08:54:46 +00:00
|
|
|
*~
|