Skip to content

[BUG] Fix errors with zap Sync method. #116

@nickeskov

Description

@nickeskov

Describe the bug
Sync method of zap returns error sync /dev/stderr: inappropriate ioctl for device. Also the strange behavior appears in tests: sync /dev/stderr: bad file descriptor.

To Reproduce
Steps to reproduce the behavior:

  1. Run nodemon any other binary from this repo. And to reproduce the second error run
  2. Send interrupt signal to the running process or wait till the end of a test.
  3. And we see the error message

Expected behavior
No error.

Desktop (please complete the following information):

  • System Version: macOS 12.6 (21G115)
  • Kernel Version: Darwin 21.6.0

Additional context
TestAnalyzer_analyzeStateHash test log:

=== RUN   TestAnalyzer_analyzeStateHash
=== RUN   TestAnalyzer_analyzeStateHash/TestCase#1
# .................. rows omitted
2022-10-19T01:23:24.318+0300	INFO	analysis/analyzer.go:154	On polling complete of 2 nodes
2022-10-19T01:23:24.318+0300	INFO	analysis/analyzer.go:160	Total statemetns count: 8
2022/10/19 01:23:24 sync /dev/stderr: bad file descriptor
--- PASS: TestAnalyzer_analyzeStateHash (0.00s)
    --- PASS: TestAnalyzer_analyzeStateHash/TestCase#1 (0.00s)
PASS

Nodemon log:

2022-10-19T01:28:09.400+0300    INFO    analysis/analyzer.go:154        On polling complete of 1 nodes
2022-10-19T01:28:09.400+0300    INFO    scraping/scraper.go:83  Polling of 1 nodes completed with 3 events collected
2022-10-19T01:28:09.400+0300    INFO    analysis/analyzer.go:160        Total statemetns count: 1
2022-10-19T01:28:09.876+0300    INFO    nodemon/nodemon.go:185  shutting down
2022/10/19 01:28:09 sync /dev/stderr: inappropriate ioctl for device

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions