@@ -1635,6 +1635,64 @@ func TestValidateWatch(t *testing.T) {
16351635 },
16361636 expectError : errBrokeResumable .Error (),
16371637 },
1638+ {
1639+ name : "Resumable - first event revision lower than watch request revision - fail" ,
1640+ reports : []report.ClientReport {
1641+ {
1642+ Watch : []model.WatchOperation {
1643+ {
1644+ Request : model.WatchRequest {
1645+ WithPrefix : true ,
1646+ Revision : 3 ,
1647+ },
1648+ Responses : []model.WatchResponse {
1649+ {
1650+ Events : []model.WatchEvent {
1651+ putWatchEvent ("a" , "1" , 2 , true ),
1652+ putWatchEvent ("b" , "2" , 3 , true ),
1653+ putWatchEvent ("c" , "3" , 4 , true ),
1654+ },
1655+ },
1656+ },
1657+ },
1658+ },
1659+ },
1660+ },
1661+ persistedRequests : []model.EtcdRequest {
1662+ putRequest ("a" , "1" ),
1663+ putRequest ("b" , "2" ),
1664+ putRequest ("c" , "3" ),
1665+ },
1666+ expectError : errBrokeResumable .Error (),
1667+ },
1668+ {
1669+ name : "Resumable - first event revision lower than watch request revision without prefix - fail" ,
1670+ reports : []report.ClientReport {
1671+ {
1672+ Watch : []model.WatchOperation {
1673+ {
1674+ Request : model.WatchRequest {
1675+ Key : "a" ,
1676+ Revision : 3 ,
1677+ },
1678+ Responses : []model.WatchResponse {
1679+ {
1680+ Events : []model.WatchEvent {
1681+ putWatchEvent ("a" , "1" , 2 , true ),
1682+ putWatchEvent ("a" , "2" , 3 , false ),
1683+ },
1684+ },
1685+ },
1686+ },
1687+ },
1688+ },
1689+ },
1690+ persistedRequests : []model.EtcdRequest {
1691+ putRequest ("a" , "1" ),
1692+ putRequest ("a" , "2" ),
1693+ },
1694+ expectError : errBrokeResumable .Error (),
1695+ },
16381696 {
16391697 name : "IsCreate - correct IsCreate values - pass" ,
16401698 reports : []report.ClientReport {
0 commit comments