-
Notifications
You must be signed in to change notification settings - Fork 129
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
More debug messages when validating internal data structures. #2088
Conversation
This is an attempt to get more information about the mysterious bug https://tests.stockfishchess.org/actions?action=log_message&user=&text=internal which seems difficult to reproduce and logically impossible to explain.
PROD running with the PR. |
I you are happy with this PR then it would be convenient if it were merged into PROD (it just contains some more refined exception handling so it should be harmless). Then I can rebase the PRs I am working on. I occasionally observe the bug in local testing but currently there is not enough information to search for the culprit. |
Actually maybe it is better to wait. I think I know what is happening. Somewhere So I will add some more code that catches this and prints a stack trace so that we can see where the error originates. |
Found it I think!
The So this seems to be a genuine Fishtest bug discovered by vtjson.... |
Ah no. It was a bug introduced in PR #1993. Master has |
Closing this for now. Will reopen if another mysterious validation bug appears. |
@vdbergh :
seems to have started on July 4th |
Yes this is normal. The results widget is no longer stored in the run, but computed on the fly. However old runs still have it and the validation code notices this. Probably the message in the log should indicate that these are runs with an older version so the error is not really an error but expected. @ppigazzini said he might write a script to clean the db. |
I have already written the script, but on DEV 29 documents cannot be cleaned, I'm investigating what it's wrong. import time
from fishtest.rundb import RunDb
def remove_unwanted_keys(rundb):
result = rundb.runs.update_many({}, {"$unset": {"results_info": ""}})
print(f"Matched {result.matched_count} documents and modified {result.modified_count} documents.")
def count_keys(rundb):
results_info_count = rundb.runs.count_documents({"results_info": {"$exists": True}})
print(f"Number of documents with 'results_info': {results_info_count}")
def print_all_results_info(rundb):
runs_with_results_info = rundb.runs.find({"results_info": {"$exists": True}})
for run in runs_with_results_info:
print(run.get("results_info"))
def main():
rundb = RunDb()
t0 = time.time()
remove_unwanted_keys(rundb)
print(time.time() - t0)
t0 = time.time()
count_keys(rundb)
print(time.time() - t0)
print_all_results_info(rundb)
if __name__ == "__main__":
main() |
|
This is an attempt to get more information about the mysterious bug
https://tests.stockfishchess.org/actions?action=log_message&user=&text=internal
which seems difficult to reproduce and logically impossible to explain.