Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Make glog tests deterministic #580

Merged
merged 1 commit into from
May 8, 2018
Merged

Make glog tests deterministic #580

merged 1 commit into from
May 8, 2018

Conversation

tzdybal
Copy link
Contributor

@tzdybal tzdybal commented May 7, 2018

solution: ensure, that log rotation is executed (by forcing atomic guard variable to desired value before the testing)

This hopefully fixes #564.

solution: ensure, that log rotation is executed (by forcing atomic guard
variable to desired value before the testing)

This hopefully fixes #564
@tzdybal tzdybal requested review from r8d8 and whilei May 7, 2018 23:00
@tzdybal
Copy link
Contributor Author

tzdybal commented May 7, 2018

Before the change, I was able to reproduce the issue (more than 1% of fail ratio). After the change, I don't see the issue after 500 repeats.

Note: please use for i in `seq 1 500`; do go test -count=1 ./logger/glog/...; done, because those tests can't be executed with -count > 1 (some package-level variables are not cleaned, because it's not necessary for "normal" execution).

@tzdybal tzdybal mentioned this pull request May 7, 2018
4 tasks
Copy link
Contributor

@whilei whilei left a comment

Choose a reason for hiding this comment

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

LGTM, and 100 tests also all pass for me. ✅

Copy link
Contributor

@whilei whilei left a comment

Choose a reason for hiding this comment

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

LGTM, and 100 tests also all pass for me. ✅

@whilei whilei merged commit 90e94e4 into master May 8, 2018
@soc1c soc1c deleted the fix/glog_tests branch June 19, 2019 12:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GLOG rotation tests are not deterministic
2 participants