storj / uplink

Storj network Go library
MIT License
115 stars 18 forks source link

Flaky test storj.io/uplink/private/eestream.TestRSRandomData #160

Closed mniewrzal closed 7 months ago

mniewrzal commented 7 months ago

storj.io/uplink/private/eestream.TestRSRandomData https://build.dev.storj.tools/job/uplink-gerrit/2765/

Stacktrace
--- FAIL: TestRSRandomData (0.63s)
Standard Output
rs_test.go:420: 
            Error Trace:    /var/lib/jenkins/workspace/uplink-gerrit/private/eestream/rs_test.go:420
                                        /var/lib/jenkins/workspace/uplink-gerrit/private/eestream/rs_test.go:337
            Error:          Not equal: 
                            expected: []byte{0xc5, 0x6f, 0x7f, 0xb, 0xd2, 0xcb, 0x96, 0x2f, 0x2c, 0xac, 0x9f, 0xf9, 0x27, 0x54, 0x20, 0x69, 0x78, 0xca, 0x34, 0x6e, 0x9e, 0x8a, 0x5b, 0xa2, 0xa3, 0x56, 0x3a, 0x70, 0x76, 0x68, 0x6a, 0x62, 0x6b, 0xf6, 0xc3, 0x71, 0x1d, 0x7d, 0x4f, 0x18, 0x4f, 0x6a, 0x4a, 0x2d, 0xe4, 0xfc, 0xa7, 0x1, 0xce, 0xf4, 0xb5, 0x19, 0x5, 0x28, 0x27, 0xc4, 0x5a, 0xe1, 0xda, 0x5f, 0xc0, 0xe0, 0xb2, 0x9b, 0x7e, 0x60, 0xb5, 0x2, 0xaa, 0x27, 0x5a, 0xb5, 0xda, 0xaf, 0x6d, 0x2d, 0x35, 0x65, 0x78, 0x33, 0xd5, 0x1c, 0x51, 0xeb, 0x75, 0xd9, 0xe7, 0x96, 0x74, 0x7e, 0xcc, 
egonelbre commented 7 months ago

https://github.com/storj/infectious/pull/1 should eventually fix this.

The underlying problem was that uplink had this logic:

for r.pendingReaders() {
    for r.readAvailableShares(ctx, num) == 0 {               // C
        <-r.newData
    }
    if r.hasEnoughShares() {
        shares := make([]infectious.Share, 0, len(r.inmap))
        for num, data := range r.inmap {
            shares = append(shares, infectious.Share{
                Number: num,
                Data:   data,                                // D
            })
        }
        out, err := r.scheme.Decode(p, shares)               // A
        if err != nil {
            if r.shouldWaitForMore(err) {                    // B
                continue
            }
storj-gerrit[bot] commented 7 months ago

Change go.mod: bump storj.io/infectious@v0.0.2 mentions this issue.