Skip to content

Commit c4962b8

Browse files
fix: removing skip from shrexeds tests and updating them to current logic (#2075)
@walldiss pointed out that there are several tests in shrexeds that were being skipped. This was from the removal of retry logic inside the protocol itself, but now I have unskipped the tests and adapted the logic
1 parent abc3897 commit c4962b8

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

share/p2p/shrexeds/exchange_test.go

+5-18
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func TestExchange_RequestEDS(t *testing.T) {
4646

4747
// Testcase: EDS is unavailable initially, but is found after multiple requests
4848
t.Run("EDS_AvailableAfterDelay", func(t *testing.T) {
49-
t.Skip()
5049
storageDelay := time.Second
5150
eds := share.RandEDS(t, 4)
5251
dah := da.NewDataAvailabilityHeader(eds)
@@ -56,33 +55,21 @@ func TestExchange_RequestEDS(t *testing.T) {
5655
// require.NoError(t, err)
5756
}()
5857

59-
now := time.Now()
6058
requestedEDS, err := client.RequestEDS(ctx, dah.Hash(), server.host.ID())
61-
finished := time.Now()
59+
assert.ErrorIs(t, err, p2p.ErrNotFound)
60+
assert.Nil(t, requestedEDS)
6261

63-
assert.Greater(t, finished.Sub(now), storageDelay)
62+
time.Sleep(storageDelay * 2)
63+
requestedEDS, err = client.RequestEDS(ctx, dah.Hash(), server.host.ID())
6464
assert.NoError(t, err)
6565
assert.Equal(t, eds.Flattened(), requestedEDS.Flattened())
6666
})
6767

6868
// Testcase: Invalid request excludes peer from round-robin, stopping request
6969
t.Run("EDS_InvalidRequest", func(t *testing.T) {
70-
t.Skip()
7170
dataHash := []byte("invalid")
7271
requestedEDS, err := client.RequestEDS(ctx, dataHash, server.host.ID())
73-
assert.ErrorIs(t, err, p2p.ErrInvalidResponse)
74-
assert.Nil(t, requestedEDS)
75-
})
76-
77-
// Testcase: Valid request, which server cannot serve, waits forever
78-
t.Run("EDS_ValidTimeout", func(t *testing.T) {
79-
t.Skip()
80-
timeoutCtx, cancel := context.WithTimeout(ctx, time.Second)
81-
t.Cleanup(cancel)
82-
eds := share.RandEDS(t, 4)
83-
dah := da.NewDataAvailabilityHeader(eds)
84-
requestedEDS, err := client.RequestEDS(timeoutCtx, dah.Hash(), server.host.ID())
85-
assert.ErrorIs(t, err, timeoutCtx.Err())
72+
assert.ErrorContains(t, err, "stream reset")
8673
assert.Nil(t, requestedEDS)
8774
})
8875

0 commit comments

Comments
 (0)