linkedin / linkedin/test-butler

Switching from offline back to online

Open
#40 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
1k
Forks
94
PR merge metrics
No merged PRs in 30d

Description

Hi there!

I have this two methods in my test-class:

```
public class ContentLoaderTest {

@Test
public void loadContent() throws Exception {

// just for sure enable both internet connection types
TestButler.setGsmState(true);
TestButler.setWifiState(true);

// place Thread.sleep(5000) here and everything is fine ;)

// networking here is failing

}

@Test
public void loadContentOffline() throws Exception {

TestButler.setGsmState(false);
TestButler.setWifiState(false);

try {

// networking here seems to be offline

} finally {
// enable it again
TestButler.setGsmState(true);
TestButler.setWifiState(true);
}

}

}
```

Method `loadContentOffline()` is started first and even if internet connectivity is reenabled again the second method is offline. It works with Thread.sleep().

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ContentLoaderTest methods and the TestButler.setGsmState(true) and setWifiState(true) calls described in the report. Reproduce the test order and check whether connectivity state is restored asynchronously; done means loadContent succeeds after loadContentOffline without Thread.sleep().

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.