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

Memory usage #159

Open
maryamaffinityclick opened this issue Jun 25, 2018 · 1 comment
Open

Memory usage #159

maryamaffinityclick opened this issue Jun 25, 2018 · 1 comment
Assignees

Comments

@maryamaffinityclick
Copy link
Collaborator

I am using nimble-snapshot with Quick and KIF frameworks.
in one test case -> in an "it" block I'm having snapshot for different screens navigating inside the app and Im getting ascending memory usage which is not realeasing .
here is my code :

it("navigate to the correct view") {
 for (index, urlString) in self.links.enumerated() {
          guard let url = URL(string: urlString) else {
                  fatalError("Couldn't create URL")
           }
                   
            //Open URL
           waitUntil(action: { (done) in
                   UIApplication.shared.open(url, options: [:], completionHandler: { (completed) in
                          if completed {
                               done()
                           } else {
                               print("couldnt open the url: ", url)
                           }
                       })
            })
           self.tester().waitForAnimationsToFinish()
            if let controller = UIApplication.shared.topMostViewController() {   
                       
                       //need some prepration for snapshot
                       switch index {
                       case 0:
                           self.tester().waitForAbsenceOfView(withAccessibilityLabel: "some loading acc label")
                       default:
                           break
                       }
                       
                       // Snapshots
             expect(controller) == recordDynamicTypeSnapshot(fileName, sizes: [.extraSmall, .small, .medium, .large, .extraLarge, .extraExtraLarge, .extraExtraExtraLarge])

                       // dismissing modal views if its presented
                      
                   }
               }
      }

I am doing manually the same scenario in the app and everything looks fine.
Is there anything I'm ding wrong here ? any idea ? after opening 20 30 links which are all push poll to navigation controller I'm getting 1.2 gig memory usage!
is it about expect(controller) == recordDynamicTypeSnapshot ?

@ashfurrow
Copy link
Owner

Hi there, I'm not sure. What happens if you replace expect(controller) == recordDynamicTypeSnapshot(...) with something like let _ = controller.loadView() or something? To see if it's a memory leak in this framework or in the controller.

@maryamaffinityclick maryamaffinityclick self-assigned this Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants