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

TestSignMessages is flaky #289

Closed
KyleMaas opened this issue Jan 2, 2023 · 8 comments
Closed

TestSignMessages is flaky #289

KyleMaas opened this issue Jan 2, 2023 · 8 comments
Labels

Comments

@KyleMaas
Copy link
Contributor

KyleMaas commented Jan 2, 2023

After a bunch of PASSes, two failures in a row:

2023/01/02 12:05:35 [margaret/indexes/badger] overwrote batch limit 0
=== RUN   TestSignMessages
badger 2023/01/02 12:05:35 INFO: All 0 tables opened in 0s
badger 2023/01/02 12:05:35 INFO: Discard stats nextEmptySlot: 0
badger 2023/01/02 12:05:35 INFO: Set nextTxnTs to 0
    publish_test.go:104: msg:0
        {
            "about": "@z+xJSnzIQtg0Dywzvl7VUzTLpj5VFajA8wZ3IRz6ztQ=.ed25519",
            "name": "test user",
            "type": "about"
          }
    publish_test.go:104: msg:1
        {
            "contact": "@p13zSAiOpguI9nsawkGijsnMfWmFd5rlUNpzekEE+vI=.ed25519",
            "following": true,
            "type": "contact"
          }
    publish_test.go:107: 
        	Error Trace:	/home/go-ssb/go-ssb/message/publish_test.go:107
        	Error:      	Expected value not to be nil.
        	Test:       	TestSignMessages
        	Messages:   	msg:1 - previous
    publish_test.go:104: msg:2
        {
            "text": "# hello world!",
            "type": "text"
          }
    publish_test.go:107: 
        	Error Trace:	/home/go-ssb/go-ssb/message/publish_test.go:107
        	Error:      	Expected value not to be nil.
        	Test:       	TestSignMessages
        	Messages:   	msg:2 - previous
badger 2023/01/02 12:05:35 INFO: Lifetime L0 stalled for: 0s
badger 2023/01/02 12:05:35 INFO: 
Level 0 [ ]: NumTables: 01. Size: 264 B of 0 B. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 64 MiB
Level 1 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 2 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 3 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 4 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 5 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 6 [B]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level Done
--- FAIL: TestSignMessages (0.05s)
FAIL
FAIL	github.com/ssbc/go-ssb/message	0.068s
FAIL
2023/01/02 12:05:38 [margaret/indexes/badger] overwrote batch limit 0
=== RUN   TestSignMessages
badger 2023/01/02 12:05:38 INFO: All 0 tables opened in 0s
badger 2023/01/02 12:05:38 INFO: Discard stats nextEmptySlot: 0
badger 2023/01/02 12:05:38 INFO: Set nextTxnTs to 0
    publish_test.go:104: msg:0
        {
            "about": "@z+xJSnzIQtg0Dywzvl7VUzTLpj5VFajA8wZ3IRz6ztQ=.ed25519",
            "name": "test user",
            "type": "about"
          }
    publish_test.go:104: msg:1
        {
            "contact": "@p13zSAiOpguI9nsawkGijsnMfWmFd5rlUNpzekEE+vI=.ed25519",
            "following": true,
            "type": "contact"
          }
    publish_test.go:107: 
        	Error Trace:	/home/go-ssb/go-ssb/message/publish_test.go:107
        	Error:      	Expected value not to be nil.
        	Test:       	TestSignMessages
        	Messages:   	msg:1 - previous
    publish_test.go:104: msg:2
        {
            "text": "# hello world!",
            "type": "text"
          }
badger 2023/01/02 12:05:38 INFO: Lifetime L0 stalled for: 0s
badger 2023/01/02 12:05:38 INFO: 
Level 0 [ ]: NumTables: 01. Size: 264 B of 0 B. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 64 MiB
Level 1 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 2 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 3 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 4 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 5 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level 6 [B]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 2.0 MiB
Level Done
--- FAIL: TestSignMessages (0.04s)
FAIL
FAIL	github.com/ssbc/go-ssb/message	0.064s
FAIL
@KyleMaas
Copy link
Contributor Author

KyleMaas commented Jan 2, 2023

We should really fix this TODO item as well:

// TODO: weird flake

@KyleMaas
Copy link
Contributor Author

KyleMaas commented Jan 2, 2023

Ah, nope, we can't fix that one until #251 is fixed. It relies on the authors index being in sync with the main log immediately after publishing, and with no way to ensure that synchronization, that would be a good thing to test but it will currently fail.

@KyleMaas
Copy link
Contributor Author

KyleMaas commented Jan 2, 2023

Filed as #290 so we can fix that later.

@KyleMaas
Copy link
Contributor Author

KyleMaas commented Jan 2, 2023

Jeepers, this test is a mess of race conditions. It's a wonder it ever worked. The tests all rely on the author log being up-to-date with the main log. See:

rootSeq, err := authorLog.Get(int64(i))

I think I might try and get this to test what it needs to without accessing the author feed. That way we can test the one thing this test is designed to test - make sure that messages are referencing each other properly when published.

@KyleMaas
Copy link
Contributor Author

KyleMaas commented Jan 2, 2023

Ugh. OpenPublishLog has the same problem internally:

authorLog, err := authorLogs.Get(storedrefs.Feed(kp.ID()))

@KyleMaas
Copy link
Contributor Author

KyleMaas commented Jan 2, 2023

Interestingly, the publish log seems to have a partial idea that the author log may be out of sync:

func (pl publishLog) Get(s int64) (interface{}, error) {

@KyleMaas
Copy link
Contributor Author

Argh! This test doesn't use sbot at all, so all of the "wait for index" stuff is useless and inapplicable here.

@decentral1se
Copy link
Member

#308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants