Skip to content
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

[1.0.3] Test failure: distributed-transactions-if-test #908

Merged
merged 4 commits into from
Oct 8, 2024
Merged

Conversation

greg7mdp
Copy link
Contributor

@greg7mdp greg7mdp commented Oct 8, 2024

Resolves #848.

This updates the verifyStartingBlockMessages check in Node.py to check that we have only one Starting block in the log for any block number unless:

  1. the block was restarted because it was exhausted,
  2. or the second Starting block is for a different block time than the first.

I have checked the new regular expression with a small python script against the log and it appears to work fine.

script:

import re

def check_file_for_pattern(file_path, pattern):
    regex = re.compile(pattern)

    with open(file_path, 'r') as file:
        for line_num, line in enumerate(file, start=1):
            match = regex.match(line)
            if match:
                blockNumber, time = match.group(1), match.group(2)
                print(f"{blockNumber} -> {time}")

if __name__ == "__main__":
    file_path = "stderr.2024_10_01_13_21_16.txt"
    pattern = r".*Starting block #(\d+) .*(\d\d:\d\d\.\d\d\d) producer"
    check_file_for_pattern(file_path, pattern)

execution:

❯ python ~/tmp/check_regexp.py
2 -> 21:17.000
3 -> 21:17.500
4 -> 21:18.000
5 -> 21:18.500
6 -> 21:19.000
7 -> 21:19.500
8 -> 21:20.000
9 -> 21:20.500
10 -> 21:21.000
...

@greg7mdp greg7mdp requested review from heifner and linh2931 October 8, 2024 12:55
@heifner
Copy link
Member

heifner commented Oct 8, 2024

2. or the second Starting block is for the exact same block time as the first

This should be: "2. or the second Starting block is for a different block time than the first."

@greg7mdp
Copy link
Contributor Author

greg7mdp commented Oct 8, 2024

This should be: "2. or the second Starting block is for a different block time than the first."

I don't think so. The full sentence is:

we should have only one Starting block in the log for any block number unless the second Starting block is for the exact same block time as the first.

@greg7mdp greg7mdp linked an issue Oct 8, 2024 that may be closed by this pull request
@heifner
Copy link
Member

heifner commented Oct 8, 2024

we should have only Starting block in the log for any block number unless the second Starting block is for the exact same block time as the first.

It is actually the opposite of that.

This should be allowed:

debug 2024-10-01T13:22:05.393 nodeos    producer_plugin.cpp:2165      start_block          ] Starting block #100 2024-10-01T13:22:06.000 producer defproducerc, deadline 2024-10-01T13:22:05.962
debug 2024-10-01T13:22:06.025 nodeos    producer_plugin.cpp:2165      start_block          ] Starting block #100 2024-10-01T13:22:06.500 producer defproducerc, deadline 2024-10-01T13:22:06.525

This should not be allowed:

debug 2024-10-01T13:22:05.393 nodeos    producer_plugin.cpp:2165      start_block          ] Starting block #100 2024-10-01T13:22:06.000 producer defproducerc, deadline 2024-10-01T13:22:05.962
debug 2024-10-01T13:22:06.025 nodeos    producer_plugin.cpp:2165      start_block          ] Starting block #100 2024-10-01T13:22:06.000 producer defproducerc, deadline 2024-10-01T13:22:06.525

@greg7mdp
Copy link
Contributor Author

greg7mdp commented Oct 8, 2024

Thanks @heifner good catch!

tests/TestHarness/Node.py Outdated Show resolved Hide resolved
@ericpassmore ericpassmore added bug The product is not working as was intended. test-instability tag issues for flaky tests, high priority to address labels Oct 8, 2024
@ericpassmore
Copy link
Contributor

Note:start
category: Tests
component: Internal
summary: Improve python test harness to better support distributed transactions tests.
Note:end

@greg7mdp greg7mdp merged commit d52e8cf into release/1.0 Oct 8, 2024
36 checks passed
@greg7mdp greg7mdp deleted the gh_848 branch October 8, 2024 17:46
@ericpassmore ericpassmore added test-bug A test is not working as was intended. and removed bug The product is not working as was intended. labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test-bug A test is not working as was intended. test-instability tag issues for flaky tests, high priority to address
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test failure: distributed-transactions-if-test
4 participants